Skip to main content
skill CX Codex

shell-expert — Claude Code skill: features and installation

shell-expert is a Claude Code skill for writing Bash, zsh, and POSIX scripts and composing command-line automation. It activates for shell pipelines and portable scripting tasks.

MIT 141 installs ★ 60 updated 2026-11-16

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add laurigates/claude-plugins --skill shell-expert -a claude-code
Open on GitHub

What shell-expert does

shell-expert helps write shell scripts and connect CLI tools into automation. It covers Bash, zsh, and POSIX, JSON and YAML work with jq, yq, and jd, file search with fd and rg, argument parsing, and error handling.

The skill addresses portability across Linux, macOS, and BSD, along with signals, cleanup via trap, and exit codes. It calls for shellcheck to lint scripts and recommends set -euo pipefail for Bash. Installing with npx skills adds ~/.claude/skills/shell-expert/SKILL.md.

What it helps with

  • write a portable Bash or POSIX script
  • connect CLI commands into a data pipeline
  • parse script arguments and handle errors
  • transform JSON or YAML with jq and yq

Example prompts for the agent

  • Write a portable POSIX script for this task.
  • Connect jq and rg in a shell pipeline to process these files.
  • Add argument parsing and error handling to this Bash script.

How to install shell-expert

1Skills CLI (Vercel)

npx skills add laurigates/claude-plugins --skill shell-expert -a claude-code

2Manually: put the files in place

~/.claude/skills/shell-expert/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/shell-expert/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about shell-expert

How do I install shell-expert in Claude Code?

Run npx skills add laurigates/claude-plugins --skill shell-expert -a claude-code. The skill file is installed at ~/.claude/skills/shell-expert/SKILL.md.

What does shell-expert do?

It helps create shell scripts, compose CLI-based automation, and work with JSON and YAML. Its guidance also covers portability, input validation, and error handling.

Which command-line tools does shell-expert cover?

It covers jq, yq, jd, fd, and rg, and recommends shellcheck for script linting.

Source text

SKILL.md · MIT
---
created: 2025-12-16
modified: 2026-11-14
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(shellcheck *), Bash(jq *), Bash(yq *), Bash(jd *), Bash(fd *), Bash(rg *), 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. Capture first, `out=$(cmd)`, then `grep -q … <<<"$out"`, or use `cmd | 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.

© laurigates · MIT · laurigates/claude-plugins

Similar skills

All skills for DevOps and infrastructure →

From the same set27

The whole set →
generate-image The generate-image skill generates images from text prompts using Google's Gemini 3 Pro Image model on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode. CX Codex +1 177installs justfile-expert justfile-expert is a Claude Code skill for designing Just recipes, parameters, dependencies, and modules. It supports adding project commands and task automation. CX Codex +1 162installs git-commit-workflow The git-commit-workflow Claude Code skill defines commit-message and staging rules. It helps split related edits into focused commits and review staged changes. CX Codex +1 161installs binary-analysis binary-analysis guides your coding agent in inspecting unknown binaries, running hex dumps, and extracting embedded artifacts. CX Codex +1 146installs rust-development A Rust development skill covering Cargo, ownership, async code, and Tokio. It fits coding tasks that mention Rust or its core tooling. CX Codex +1 108installs clippy-advanced clippy-advanced guides Clippy setup for Rust projects: custom lints, clippy.toml thresholds, suppression rules, and CI check commands. CX Codex +1 107installs playwright-testing The playwright-testing skill guides Playwright E2E work for web apps, including browser coverage, mobile viewports, API checks, and visual snapshots. CX Codex +1 106installs api-testing api-testing — a skill for writing REST and GraphQL API tests with Supertest (TypeScript) and httpx/pytest (Python). Validates status codes, response schemas, auth flows, and error handling. CX Codex +1 106installs

Project sponsors

Companies that keep this analytics open