Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate shell completion scripts for bash, zsh, and fish from CLI command definitions. Creates intelligent completions with argument suggestions, file completions, and dynamic values.
.claude/skills/a5c-ai-shell-completion-generator/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 35% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 69% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 106% | 0% |
| case-16 | ✗→✓ | ▲ Improved | 110% | 0% |
Generate comprehensive shell completion scripts for bash, zsh, and fish shells from CLI command definitions.
Invoke this skill when you need to:
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | cliName | string | Yes | Name of the CLI executable | | commands | array | Yes | Command definitions with options | | shells | array | No | Target shells (default: all) | | outputDir | string | No | Output directory for scripts | | dynamic | object | No | Dynamic completion configurations |
json{ "commands": [ { "name": "deploy", "description": "Deploy application to environment", "options": [ { "flags": ["-e", "--env"], "description": "Target environment", "type": "choice", "choices": ["dev", "staging", "prod"] }, { "flags": ["-c", "--config"], "description": "Config file path", "type": "file", "extensions": [".json", ".yaml", ".yml"] } ], "arguments": [ { "name": "service", "description": "Service to deploy", "type": "dynamic", "source": "services-list" } ], "subcommands": [ { "name": "status", "description": "Check deployment status" } ] } ] }
completions/
├── bash/
│ └── <cliName>.bash # Bash completion script
├── zsh/
│ └── _<cliName> # Zsh completion function
├── fish/
│ └── <cliName>.fish # Fish completion script
└── install.sh # Installation helper scriptbash#!/bin/bash # Completion script for mycli _mycli_completions() { local cur prev words cword _init_completion || return local commands="deploy rollback status config" case "${prev}" in mycli) COMPREPLY=($(compgen -W "${commands}" -- "${cur}")) return ;; deploy) COMPREPLY=($(compgen -W "--env --config --dry-run" -- "${cur}")) return ;; --env|-e) COMPREPLY=($(compgen -W "dev staging prod" -- "${cur}")) return ;; --config|-c) _filedir '@(json|yaml|yml)' return ;; esac # Handle subcommands if [[ ${words[1]} == "deploy" ]]; then case "${prev}" in status) # Dynamic completion for services local services=$(_mycli_get_services) COMPREPLY=($(compgen -W "${services}" -- "${cur}")) return ;; esac fi COMPREPLY=($(compgen -W "${commands}" -- "${cur}")) } # Dynamic completion helper _mycli_get_services() { mycli services list --quiet 2>/dev/null } complete -F _mycli_completions mycli
zsh#compdef mycli _mycli() { local -a commands commands=( 'deploy:Deploy application to environment' 'rollback:Rollback to previous version' 'status:Check deployment status' 'config:Manage configuration' ) local -a deploy_options deploy_options=( '(-e --env)'{-e,--env}'[Target environment]:environment:(dev staging prod)' '(-c --config)'{-c,--config}'[Config file path]:config file:_files -g "*.{json,yaml,yml}"' '--dry-run[Preview changes without applying]' ) _arguments -C \ '1: :->command' \ '*:: :->args' case $state in command) _describe -t commands 'mycli commands' commands ;; args) case $words[1] in deploy) _arguments $deploy_options \ '1:service:_mycli_services' ;; rollback) _arguments \ '(-v --version)'{-v,--version}'[Version to rollback]:version:_mycli_versions' ;; esac ;; esac } # Dynamic completion for services _mycli_services() { local -a services services=(${(f)"$(mycli services list --quiet 2>/dev/null)"}) _describe -t services 'services' services } _mycli "$@"
fish# Completions for mycli # Disable file completions by default complete -c mycli -f # Main commands complete -c mycli -n __fish_use_subcommand -a deploy -d 'Deploy application to environment' complete -c mycli -n __fish_use_subcommand -a rollback -d 'Rollback to previous version' complete -c mycli -n __fish_use_subcommand -a status -d 'Check deployment status' complete -c mycli -n __fish_use_subcommand -a config -d 'Manage configuration' # Deploy options complete -c mycli -n '__fish_seen_subcommand_from deploy' -s e -l env -d 'Target environment' -xa 'dev staging prod' complete -c mycli -n '__fish_seen_subcommand_from deploy' -s c -l config -d 'Config file path' -r -F complete -c mycli -n '__fish_seen_subcommand_from deploy' -l dry-run -d 'Preview changes' # Deploy subcommands complete -c mycli -n '__fish_seen_subcommand_from deploy' -a status -d 'Check deployment status' # Dynamic service completion function __mycli_services mycli services list --quiet 2>/dev/null end complete -c mycli -n '__fish_seen_subcommand_from deploy; and not __fish_seen_subcommand_from status' -a '(__mycli_services)' -d 'Service'
| Type | Description | Example | |------|-------------|---------| | choice | Fixed list of values | environments, formats | | file | File path completion | config files | | directory | Directory path completion | output paths | | dynamic | Runtime-generated values | services, branches | | command | Subcommand completion | nested commands | | none | No completion | free-form text |
json{ "dynamic": { "services-list": { "command": "mycli services list --quiet", "cache": 60 }, "git-branches": { "command": "git branch --format='%(refname:short)'", "cache": 10 }, "docker-images": { "command": "docker images --format '{{.Repository}}:{{.Tag}}'", "cache": 30 } } }
bash#!/bin/bash # install.sh - Install shell completions for mycli SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" install_bash() { local dest="${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions" mkdir -p "$dest" cp "$SCRIPT_DIR/bash/mycli.bash" "$dest/mycli" echo "Installed bash completion to $dest/mycli" } install_zsh() { local dest="${ZDOTDIR:-$HOME}/.zfunc" mkdir -p "$dest" cp "$SCRIPT_DIR/zsh/_mycli" "$dest/_mycli" echo "Add 'fpath=(~/.zfunc \$fpath)' to .zshrc if not present" echo "Installed zsh completion to $dest/_mycli" } install_fish() { local dest="${XDG_CONFIG_HOME:-$HOME/.config}/fish/completions" mkdir -p "$dest" cp "$SCRIPT_DIR/fish/mycli.fish" "$dest/mycli.fish" echo "Installed fish completion to $dest/mycli.fish" } case "$1" in bash) install_bash ;; zsh) install_zsh ;; fish) install_fish ;; all|"") install_bash install_zsh install_fish ;; *) echo "Usage: $0 [bash|zsh|fish|all]" exit 1 ;; esac
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 19,856 | 18,838 | -5% | 1 | 1 | 0% | 4,340 | 6,845 | +58% | 0 | 0 | — |
case-02 | fail→pass | 25,340 | 29,394 | +16% | 1 | 1 | 0% | 6,212 | 8,379 | +35% | 0 | 0 | — |
case-03 | fail→fail | 11,679 | 10,205 | -13% | 1 | 1 | 0% | 2,207 | 4,411 | +100% | 0 | 0 | — |
case-04 | pass→pass | 10,061 | 8,912 | -11% | 1 | 1 | 0% | 1,843 | 4,300 | +133% | 0 | 0 | — |
case-05 | fail→fail | 3,452 | 3,823 | +11% | 1 | 1 | 0% | 693 | 3,136 | +353% | 0 | 0 | — |
case-06 | fail→pass | 13,547 | 11,340 | -16% | 1 | 1 | 0% | 2,889 | 4,892 | +69% | 0 | 0 | — |
case-07 | fail→pass | 8,966 | 6,190 | -31% | 1 | 1 | 0% | 1,799 | 3,697 | +106% | 0 | 0 | — |
case-08 | fail→fail | 7,705 | 5,298 | -31% | 1 | 1 | 0% | 1,183 | 3,451 | +192% | 0 | 0 | — |
case-09 | fail→fail | 13,227 | 15,403 | +16% | 1 | 1 | 0% | 2,666 | 5,734 | +115% | 0 | 0 | — |
case-10 | fail→fail | 4,060 | 4,089 | +1% | 1 | 1 | 0% | 894 | 3,336 | +273% | 0 | 0 | — |
case-11 | fail→fail | 6,090 | 6,430 | +6% | 1 | 1 | 0% | 1,409 | 3,844 | +173% | 0 | 0 | — |
case-12 | fail→fail | 7,055 | 6,737 | -5% | 1 | 1 | 0% | 1,130 | 3,654 | +223% | 0 | 0 | — |
case-13 | fail→fail | 11,046 | 12,925 | +17% | 1 | 1 | 0% | 2,061 | 4,563 | +121% | 0 | 0 | — |
case-14 | fail→fail | 8,695 | 11,025 | +27% | 1 | 1 | 0% | 1,972 | 4,958 | +151% | 0 | 0 | — |
case-15 | fail→fail | 6,978 | 6,320 | -9% | 1 | 1 | 0% | 1,423 | 3,812 | +168% | 0 | 0 | — |
case-16 | fail→pass | 8,265 | 6,475 | -22% | 1 | 1 | 0% | 1,868 | 3,929 | +110% | 0 | 0 | — |
case-17 | fail→fail | 8,155 | 4,420 | -46% | 1 | 1 | 0% | 1,664 | 3,412 | +105% | 0 | 0 | — |
case-18 | fail→fail | 13,881 | 12,711 | -8% | 1 | 1 | 0% | 3,068 | 5,479 | +79% | 0 | 0 | — |
case-19 | fail→fail | 10,333 | 5,698 | -45% | 1 | 1 | 0% | 1,941 | 3,457 | +78% | 0 | 0 | — |
case-20 | fail→fail | 9,423 | 10,904 | +16% | 1 | 1 | 0% | 1,597 | 4,777 | +199% | 0 | 0 | — |
case-21 | fail→fail | 9,788 | 8,980 | -8% | 1 | 1 | 0% | 1,799 | 4,191 | +133% | 0 | 0 | — |
case-22 | fail→fail | 13,223 | 11,162 | -16% | 1 | 1 | 0% | 2,722 | 4,754 | +75% | 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.