shell-style

Enforce POSIX-compliant shell scripting conventions across repositories.

19|1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/nevir/agentfill --skill shell-style
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-style
Source: https://github.com/nevir/agentfill/tree/main/.agents/skills/shell-style
Command: npx skills add https://github.com/nevir/agentfill --skill shell-style

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide standardizes POSIX shell scripting practices to improve portability, readability, and reliability across environments by enforcing POSIX-compliant conventions.

Core Features & Use Cases

  • Enforce POSIX compatibility by avoiding bashisms and using [ ] tests, proper quoting, and tab-based indentation.
  • Provide a consistent script structure including shebang, set -e, modular utilities, and clearly separated sections.
  • Real-world scenario: refactor a collection of .sh files to ensure POSIX compatibility and predictable behavior on Linux, macOS, and Windows shells.

Quick Start

Review and refactor your shell scripts to conform to the POSIX shell style guide.

Frequently Asked Questions about shell-style

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce POSIX shell style in my scripts?

You can enforce POSIX shell style by applying rules that mandate tab-based indentation, proper quoting, and POSIX-compliant tests like [ ] instead of bashisms. This standardizes script structure including shebangs and set -e for predictable behavior.

What are common bashisms to avoid for portable shell scripting?

Common bashisms to avoid include using non-POSIX test brackets and improper variable quoting. Avoiding these bashisms and enforcing POSIX shell style ensures your scripts maintain compatibility and predictable behavior across Linux, macOS, and Windows shells.

How do I refactor shell scripts to be POSIX compliant?

To refactor shell scripts to be POSIX compliant, review and update them to use [ ] tests, proper quoting, and tab-based indentation. This refactoring process aligns your collection of .sh files with the POSIX shell style guide.

Does POSIX shell style work across Linux, macOS, and Windows shells?

Yes, POSIX shell style works across Linux, macOS, and Windows shells. By enforcing POSIX-compliant conventions and avoiding bashisms, the style guide maximizes portability, readability, and maintainability of your scripts across different environments.

Why does my shell script fail on different operating systems?

Your shell script might fail on different operating systems due to bashisms and non-POSIX compliant practices. Enforcing POSIX shell style with standard structure and proper quoting resolves these portability issues across Linux, macOS, and Windows shells.

What structure should a portable POSIX shell script follow?

A portable POSIX shell script should follow a consistent structure including a shebang, set -e for error handling, modular utilities, and clearly separated sections. This POSIX shell style structure improves readability and reliability across environments.