Loading...
Loading...
Shell scripting and terminal integration patterns for building tools that integrate with Zsh, Bash, and Fish. Covers completion systems (compdef/compadd, complete/compgen, fish complete), ZLE widgets, hooks (precmd/preexec/chpwd, PROMPT_COMMAND), readline, bindkey, parameter expansion, ZDOTDIR loading order, event systems, abbreviations, POSIX shell scripting, terminal control codes (ANSI/CSI escape sequences), tput, stty, signal handling, process management (job control, traps), and shell plugin distribution patterns. Use when building shell plugins, writing completion scripts, implementing terminal UI with escape sequences, managing dotfiles, creating installation scripts, handling signals and process management, or integrating native binaries with shell wrappers.
npx skill4agent add oakoss/agent-skills shell-integration| Pattern | Shell | Key Points |
|---|---|---|
| Completion function | Zsh | |
| Completion function | Bash | |
| Completion function | Fish | |
| ZLE widget | Zsh | |
| Prompt hook | Zsh | |
| Prompt hook | Bash | |
| Event handler | Fish | |
| Abbreviation | Fish | |
| Parameter expansion | Zsh | |
| Terminal control | All | ANSI/CSI escape sequences, |
| Signal handling | All | |
| Process management | All | Job control ( |
| Plugin installation | All | Sourcing strategies, version detection, |
| Mistake | Correct Pattern |
|---|---|
Using | Use |
Modifying | Append with |
| Defining Fish event handlers in lazy-loaded functions | Place event handlers in config.fish or source them explicitly |
| Hardcoding terminal capabilities | Query via |
Missing | Always set local options to avoid polluting caller environment |
Using | Use |
Not quoting | Always use |
Assuming | Target POSIX sh for portable scripts, test with |
Using | Use |
Ignoring | Always set |
ExploreTaskcode-reviewerIf theskill is available, delegate native binary compilation patterns to it. Shell wrappers often invoke Rust-compiled binaries for performance-critical operations. If therustskill is available, delegate modern CLI utility patterns to it. Many shell plugins wrap tools likecli-power-tools,fd, andripgrep.fzf