Skip to content
Skills Library
Programming · Building & coding

shell-expert

/shell-expert

Shell scripting: bash, zsh, POSIX, CLI tools, cross-platform automation. Use when writing shell scripts, pipes, command-line automation, or portable shell code.

Licence
MIT
Last repository change
24.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 24.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Shell scripting: bash, zsh, POSIX, CLI tools, cross-platform automation. Use when writing shell scripts, pipes, command-line automation, or portable shell code.

Original author description

Shell scripting: bash, zsh, POSIX, CLI tools, cross-platform automation. Use when writing shell scripts, pipes, command-line automation, or portable shell code.

How it works

  1. When to Use This Skill
  2. Key Capabilities
  3. Essential Commands
  4. Best Practices
  5. Common Patterns
Original SKILL.md headings · 160 lines, 780 words
SKILL.md preview
---
created: 2025-12-16
modified: 2026-09-24
reviewed: 2026-04-25
name: shell-expert
description: "Shell scripting: bash, zsh, POSIX, CLI tools, cross-platform automation. Use when writing shell scripts, pipes, command-line automation, or portable shell code."
user-invocable: false
allowed-tools: Bash, Grep, Glob, Read, Write, Edit, TodoWrite
---

# Shell Expert

Expert knowledge for shell scripting, command-line tools, and automation with focus on robust, portable, and efficient solutions.

## When to Use This Skill

| Use this skill when... | Use justfile-expert instead when... |
|---|---|
| Authoring portable bash, zsh, or POSIX shell scripts | Wrapping commands as named recipes for a project task runner |
| Composing pipelines and one-off automation logic | Standardising entry points across a team or repo |
| Hardening scripts with `set -euo pipefail`, traps, and quoting | Defining cross-platform commands without writing shell glue |

| Use this skill when... | Use jq-json-processing instead when... |
|---|---|
| Glue logic that wires together CLI tools | The work is purely transforming JSON input |
| Writing reusable functions, argument parsing, or signal handling | A single jq expression can replace a chain of shell commands |

**Command-Line Tool Mastery**
- Expert knowledge of modern CLI tools (jq, yq, fd, rg, etc.)
- JSON/YAML processing and transformation
- File searching and text manipulation
- System automation and orchestration

**Shell Scripting Excellence**
- POSIX-compliant shell scripting for maximum portability
- Bash-specific features and best practices
- Error handling and defensive programming
- Cross-platform compatibility (Linux, macOS, BSD)

**Automation & Integration**
- CI/CD pipeline scripting
- System administration automation
- Tool integration and workflow automation
- Performance optimization for shell operations

## Key Capabilities

**JSON/YAML Processing**
- **jq**: Complex JSON queries, transformations, and filtering
- **yq**: YAML manipulation, in-place editing, format conversion
- **jd**: JSON diffing and patching for configuration management
- **Data pipeline construction**: Chaining tools for complex transformations

**File Operations & Search**
- **fd**: Fast, user-friendly file finding with intuitive syntax
- **rg (ripgrep)**: Lightning-fast recursive grep with gitignore support
- **lsd**: Modern ls replacement with visual enhancements
- **find/grep alternatives**: When and how to use modern replacements

**Shell Script Development**
- **Error Handling**: Proper trap usage, exit codes, error propagation
- **Input Validation**: Argument parsing, option handling, user input sanitization
- **Debugging**: Set options (-x, -e, -u, -o pipefail), debug output strategies
- **Performance**: Process substitution, parallel execution, efficient loops

**Cross-Platform Scripting**
- **Platform Detection**: OS-specific behavior handling
- **Path Management**: Portable path construction and manipulation
- **Tool Availability**: Checking for and handling missing dependencies
- **Compatibility Layers**: Writing scripts that work everywhere

**Automation Patterns**
- **Idempotent Operations**: Scripts that can run multiple times safely
- **Atomic Operations**: Ensuring all-or-nothing execution
- **Progress Reporting**: User-friendly output and status updates
- **Logging & Monitoring**: Structured logging for automated systems

## Essential Commands

**jq - JSON Processing**
```bash
jq . data.json                                    # Pretty-print
jq -r '.key.subkey' data.json                     # Extract value
jq '.items[] | select(.status == "active")'       # Filter
```

**yq - YAML Processing**
```bash
yq '.services.web.image' docker-compose.yml       # Read value
yq -i '.version = "2.1.0"' config.yml            # Update in-place
yq -o json config.yml                             # Convert to JSON
```

**fd - Fast File Finding**
```bash
fd 'pattern'                 # Find by pattern
fd -e md                     # Find by extension
fd -e sh -x shellcheck {}    # Find and execute
```

**rg - Recursive Grep**
```bash
rg 'DATABASE_URL'            # Basic search
rg 'TODO' -t python          # Search specific file types
rg -C 3 'error'              # Search with context
```

## Best Practices

**Script Development Workflow**
1. **Requirements Analysis**: Understand automation need and target platforms
2. **Tool Selection**: Choose appropriate tools for the task
3. **Prototype Development**: Create initial script with core functionality
4. **Error Handling**: Add robust error handling and edge case management
5. **Cross-Platform Testing**: Verify script works on all target systems
6. **Performance Optimization**: Profile and optimize for efficiency
7. **Documentation**: Add clear usage instructions and inline comments

**Critical Guidelines**
- Always use shellcheck for linting
- Set strict mode: `set -euo pipefail`
- Under `pipefail`, never pipe into a reader that exits early (`grep -q`, `head`): the producer gets SIGPIPE and a pipeline that succeeded reports failure, intermittently. Use `grep -q … <<<"$var"` or `grep … >/dev/null` (see REFERENCE.md)
- Quote all variables: `"${var}"`
- Use functions for reusable code
- Implement proper cleanup with trap
- Provide helpful error messages
- Include --help and --version options
- Use meaningful variable names
- Comment complex logic
- Test with different shells when targeting POSIX

## Common Patterns

**Robust Script Template**
```bash
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'

trap 'echo "Error on line $LINENO"' ERR
trap cleanup EXIT

cleanup() {
    rm -f "$TEMP_FILE" 2>/dev/null || true
}

main() {
    parse_args "$@"
    validate_environment
    execute_task
}

main "$@"
```

**Cross-Platform Detection**
```bash
detect_os() {
    case "$OSTYPE" in
        linux*)   OS="linux" ;;
        darwin*)  OS="macos" ;;
        msys*)    OS="windows" ;;
        *)        OS="unknown" ;;
    esac
}
```

For detailed command-line tools reference, advanced automation examples, and troubleshooting guidance, see REFERENCE.md.
Files in this package (2)
  • REFERENCE.md 11 KB
  • SKILL.md 6 KB

Versions

RepositoryScoreLicence
This page · laurigates/claude-plugins100MIT
aAAaqwq/AGI-Super-Team100MIT

Database snapshot: 13.11.2026 · package version e927f0909e32 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95bash
    Use when writing shell scripts or working with Bash, Zsh, or POSIX-compatible shells on macOS and Linux. Covers scripting fundamentals, variables, control flow, functions, pipes, process management, and common patterns for automation and developer tooling. USE FOR: Bash, Zsh,…
  • 100shell
    Shell scripting best practices and conventions for bash, sh, zsh, and other shells Triggers on: **/*.sh
  • 100shell-scripting
    Bash, Zsh, POSIX sh, Fish scripts, one-liners, dotfiles, completions. Use for quoting or globbing bugs, shellcheck warnings, porting between shells.
  • 100scripting-bash
    Master defensive Bash scripting for production automation, CI/CD pipelines, and system utilities. Expert in safe, portable, and testable shell scripts with POSIX compliance, modern Bash 5.x features, and comprehensive error handling. Use when writing shell scripts, bash…
  • 90shell-scripts
    Use when writing or reviewing Bash scripts and shell snippets, especially for shebang selection, quoting, parameter expansion ("${VAR}" style), test expressions (`[ ]` vs `[[ ]]`), ShellCheck-guided fixes, and portability decisions across POSIX sh, Bash, and zsh compatibility targets.
  • 100bash
    Expert Bash shell scripting assistance covering POSIX compliance, parameter expansion, pipelines, traps, and debugging. Use when writing robust shell scripts, automating DevOps tasks, or handling file processing.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.