write-script-bash

Write Bash scripts with positional arguments and JSON output.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/adamkingsbury/unified-data-model --skill write-script-bash-adamkingsbury
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: write-script-bash
Source: https://github.com/adamkingsbury/unified-data-model/tree/main/.claude/skills/write-script-bash
Command: npx skills add https://github.com/adamkingsbury/unified-data-model --skill write-script-bash-adamkingsbury

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill guides you to write robust Bash scripts by enforcing best practices like consistent argument handling, avoiding shebang, and clear output formatting.

Core Features & Use Cases

  • Enforces argument handling conventions (positional parameters, no shebang)
  • Demonstrates output of JSON to stdout for structured data
  • Provides examples of environment variable usage and safe scripting patterns

Quick Start

Create a simple Bash script that accepts two positional arguments, does not include a shebang, and prints a JSON object to stdout.

Frequently Asked Questions about write-script-bash

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

FAQPage Schema
How do I write a Bash script with consistent argument parsing and JSON output?

To write a Bash script with consistent argument parsing and JSON output, standardize positional parameter handling and print structured JSON objects to stdout for deterministic CLI behavior.

What are the best practices for safe Bash scripting in automation utilities?

Safe Bash scripting best practices for automation utilities include avoiding shebangs, using positional parameters as strings, applying basic safety patterns, and formatting outputs as structured JSON.

Do I need to include a shebang when writing shell scripts for command-line tools?

No, you do not need to include a shebang when writing shell scripts for command-line tools; this skill specifically enforces a no-shebang convention using positional parameters.

Can Bash scripts output structured JSON to stdout for CLI automation?

Yes, Bash scripts can output structured JSON to stdout for CLI automation. This skill demonstrates formatting script output as JSON objects for deterministic data handling.

How do I access environment variables in a Bash script using safe scripting patterns?

Access environment variables in a Bash script using safe scripting patterns by referencing them directly within the script's execution context without requiring complex dependencies.

Why does my Bash script behave inconsistently across different automation environments?

Bash scripts behave inconsistently across automation environments due to non-standardized argument handling and formatting; enforcing positional parameters and structured JSON output resolves this.