← ClaudeAtlas

fish-shell-scriptinglisted

Fish shell scripting judgment frameworks and critical idioms. Use when writing Fish scripts or shell automation. Focuses on when to use Fish vs bash, macOS/Fedora compatibility requirements, and Fish-specific patterns that prevent bugs (universal variable anti-patterns, wrapper functions, interactive guards).
Pyroxin/opinionated-claude-skills · ★ 5 · AI & Automation · score 72
Install: claude install-skill Pyroxin/opinionated-claude-skills
# Fish Shell Scripting **Related skills:** - `software-engineer` - General scripting design principles - `python-programmer` - When shell complexity exceeds ~100 lines, consider Python <core_philosophy> **Fish is a user-friendly shell that prioritizes correctness over POSIX compatibility.** Its lists-not-strings semantics eliminates entire classes of bugs common in bash/zsh. The limitation is portability, not capability. **Key insight**: Fish handles sophisticated automation well. Choose Fish when you control the environment; choose bash when you don't. </core_philosophy> ## Platform Requirements <platform_requirements> **Compatibility**: All Fish scripts MUST work on both macOS and Fedora Linux. Handle platform differences via `uname` detection. **Quote paths with spaces**: Always quote file paths even though Fish has no word splitting. Fish doesn't need quotes technically (no word splitting), but quoting anyway: (1) makes intent explicit for readability, (2) builds consistent habits when switching between shells, (3) ensures compatibility when passing to external commands that may interpret spaces. **Shebang**: Use `#!/usr/bin/env fish` for portability across installation locations. </platform_requirements> ## When to Use Fish vs Other Tools <fish_vs_alternatives> **Use Fish for:** - Automation on systems where Fish is installed (dev environments, personal machines, containers you control) - Scripts benefiting from lists-not-strings semantics and strong scoping - C