Authors zsh _command completion files using _arguments/_describe/_values, ZLS_COLORS, compinit/compdef/fpath, and fzf-tab previews. Use for subcommand trees, dynamic completions, or debugging.
Ships in zsh-completions. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write zsh completion scripts with rich descriptions, colors, and dynamic completions.
Place completion files in ~/.config/zsh/completions/ with _commandname naming.
#compdef mycommand
_mycommand() {
_arguments \
'-h[Show help]' \
'--verbose[Enable verbose output]' \
'1:action:(start stop restart)' \
'*:files:_files'
}
_mycommand "$@"
| Function | Purpose | Reference |
|---|---|---|
_arguments | Flags + positional args | references/arguments.md |
_describe | Lists with descriptions | references/describe.md |
_values | Comma-separated values | references/arguments.md |
_alternative | Multiple completion types | references/patterns.md |
# Static options with descriptions
_arguments \
'-f[Force operation without confirmation]' \
'-v[Verbose output]' \
'--config[Config file path]:file:_files'
# Dynamic list with descriptions
local -a commands
commands=(
'start:Start the service'
'stop:Stop the service'
'status:Show current status'
)
_describe 'command' commands
# Query external command
_mycommand_targets() {
local -a targets
targets=(${(f)"$(mycommand list-targets 2>/dev/null)"})
_describe 'target' targets
}
# With descriptions from JSON
local -a items
items=($(mycommand --json | jq -r '.[] | "\(.name):\(.desc)"'))
_describe 'item' items
See references/colors.md for ZLS_COLORS configuration.
# In zstyle (completions.zsh)
zstyle ':completion:*:descriptions' format '%F{green}-- %d --%f'
zstyle ':completion:*:warnings' format '%F{red}No matches%f'
# Color by file type
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
For nested commands like git remote add, see references/patterns.md.
_arguments -C \
'1:command:->cmd' \
'*::arg:->args'
case $state in
cmd) _describe 'command' commands ;;
args)
case $words[1] in
start) _mycommand_start ;;
stop) _mycommand_stop ;;
esac ;;
esac
See references/fzf-tab.md for full configuration.
# Group completions using tags
_describe -t commands 'command' commands
_describe -t options 'option' options
# Enable group switching
zstyle ':fzf-tab:*' show-group full
zstyle ':fzf-tab:*' switch-group '<' '>'
# Command-specific preview using fzf.zsh
zstyle ':fzf-tab:complete:mycommand:*' fzf-preview 'fzf.zsh $realpath'
See references/compinit.md for initialization details.
# Ensure fpath includes your completions dir
fpath=(~/.config/zsh/completions $fpath)
# Initialize (in .zshrc or completions.zsh)
autoload -Uz compinit && compinit
# With zinit (turbo mode)
zinit ice wait lucid atinit"zicompinit; zicdreplay"
zinit light zdharma-continuum/fast-syntax-highlighting
references/arguments.md - _arguments syntax and optspecsreferences/arguments-values.md - _values function and file filteringreferences/describe.md - _describe for dynamic listsreferences/colors.md - ZLS_COLORS and stylingreferences/compinit.md - Completion system internals (fpath, compdef, zinit)references/compinit-debug.md - Debugging and troubleshootingreferences/patterns.md - Subcommand trees and common patternsreferences/patterns-advanced.md - Current word analysis and cachingreferences/fzf-tab.md - fzf-tab grouping, previews, fzf.zsh scriptreferences/fzf-tab-advanced.md - Custom previews and context extractionconfig.yaml (opens in a new tab)references/arguments-values.md (opens in a new tab)references/arguments.md (opens in a new tab)references/colors.md (opens in a new tab)references/compinit-debug.md (opens in a new tab)references/compinit.md (opens in a new tab)references/describe.md (opens in a new tab)references/fzf-tab-advanced.md (opens in a new tab)references/fzf-tab.md (opens in a new tab)references/patterns-advanced.md (opens in a new tab)references/patterns.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/zsh-completions:zsh-completionsfrom zsh-completions
npx claudepluginhub kettleofketchup/kettleofskills --plugin zsh-completions