Agent skill

Bash Script Template

by majiayu000 in majiayu000/claude-skill-registry

Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations.

MITAuto-check: notesDevelopment

Install Bash Script Template

skills CLI
$ npx skills add majiayu000/claude-skill-registry --skill bash-script-template -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install majiayu000/claude-skill-registry bash-script-template --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/majiayu000/claude-skill-registry.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/bash/bash-script-template .claude/skills/bash-script-template && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
bash-script-template
GitHub stars
666
Used in
1 other repo
Token cost
~983 tokens
SKILL.md length
98 words
Files
2
Skills in repo
1,273
Repo updated
First seen
Licence
MIT

At a glance

Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations.

  • Tasks that involve Shell scripting
  • SKILL.md covers Capabilities, Usage, Inputs and Generated Template, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Bash Script Template is an agent skill from majiayu000/claude-skill-registry. Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations.

Its SKILL.md is about 980 tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `metadata.json`).

It sits in Development, covering Shell scripting. It works with Bash. The repository describes itself as: Searchable Claude Code skills catalog with source-linked guides and generated registry artifacts. The licence is MIT.

When your agent uses it

  • Tasks that involve Shell scripting

Example prompts

  • “/bash-script-template”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep

What it can do on your machine

Read from SKILL.md and the folder at commit 2d14a69. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Bash Script Template loads about 983 tokens when it runs. Until then it costs about 39 tokens; SKILL.md has 98 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~39
When it runs · the whole SKILL.md, loaded when a task matches
~983

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from majiayu000/claude-skill-registry at commit 2d14a69, republished under its MIT licence (© majiayu000). 98 words, ~983 tokens.

Download SKILL.mdSave it as .claude/skills/bash-script-template/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
bash-script-template
description
Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep

Bash Script Template

Generate bash script templates with best practices.

Capabilities

  • Generate robust bash script templates
  • Set up proper error handling
  • Implement argument parsing with getopts
  • Create logging utilities
  • Configure strict mode settings
  • Generate reusable function libraries

Usage

Invoke this skill when you need to:

  • Create new bash scripts with best practices
  • Set up proper error handling patterns
  • Implement argument parsing
  • Create portable shell scripts

Inputs

ParameterTypeRequiredDescription
scriptNamestringYesScript name
descriptionstringYesScript description
argumentsarrayNoScript arguments
functionsarrayNoFunctions to include

Generated Template

bash
#!/usr/bin/env bash
#
# <scriptName> - <description>
#
# Usage: <scriptName> [options] <arguments>
#

set -euo pipefail
IFS=$'\n\t'

# Script directory
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"

# Colors (if terminal supports)
if [[ -t 1 ]]; then
    readonly RED='\033[0;31m'
    readonly GREEN='\033[0;32m'
    readonly YELLOW='\033[0;33m'
    readonly BLUE='\033[0;34m'
    readonly NC='\033[0m'
else
    readonly RED='' GREEN='' YELLOW='' BLUE='' NC=''
fi

# Logging functions
log_info() { echo -e "${BLUE}[INFO]${NC} $*"; }
log_success() { echo -e "${GREEN}[OK]${NC} $*"; }
log_warn() { echo -e "${YELLOW}[WARN]${NC} $*" >&2; }
log_error() { echo -e "${RED}[ERROR]${NC} $*" >&2; }
die() { log_error "$*"; exit 1; }

# Cleanup on exit
cleanup() {
    # Add cleanup tasks here
    :
}
trap cleanup EXIT

# Usage
usage() {
    cat <<EOF
Usage: ${SCRIPT_NAME} [options] <argument>

<description>

Options:
    -h, --help      Show this help message
    -v, --verbose   Enable verbose output
    -d, --dry-run   Show what would be done
    -f, --force     Force operation
    -o, --output    Output file path

Arguments:
    argument        Required argument description

Examples:
    ${SCRIPT_NAME} -v input.txt
    ${SCRIPT_NAME} --output result.txt input.txt
EOF
}

# Parse arguments
parse_args() {
    local OPTIND opt
    while getopts ":hvdfo:-:" opt; do
        case "${opt}" in
            h) usage; exit 0 ;;
            v) VERBOSE=true ;;
            d) DRY_RUN=true ;;
            f) FORCE=true ;;
            o) OUTPUT="${OPTARG}" ;;
            -)
                case "${OPTARG}" in
                    help) usage; exit 0 ;;
                    verbose) VERBOSE=true ;;
                    dry-run) DRY_RUN=true ;;
                    force) FORCE=true ;;
                    output=*) OUTPUT="${OPTARG#*=}" ;;
                    *) die "Unknown option: --${OPTARG}" ;;
                esac
                ;;
            :) die "Option -${OPTARG} requires an argument" ;;
            ?) die "Unknown option: -${OPTARG}" ;;
        esac
    done
    shift $((OPTIND - 1))

    # Required arguments
    if [[ $# -lt 1 ]]; then
        usage
        die "Missing required argument"
    fi

    ARGUMENT="$1"
}

# Defaults
VERBOSE=${VERBOSE:-false}
DRY_RUN=${DRY_RUN:-false}
FORCE=${FORCE:-false}
OUTPUT=${OUTPUT:-}

# Main function
main() {
    parse_args "$@"

    if [[ "${VERBOSE}" == true ]]; then
        log_info "Verbose mode enabled"
    fi

    if [[ "${DRY_RUN}" == true ]]; then
        log_warn "Dry run mode - no changes will be made"
    fi

    log_info "Processing: ${ARGUMENT}"

    # Main logic here

    log_success "Done!"
}

main "$@"

Target Processes

  • shell-script-development
  • cross-platform-cli-compatibility
  • cli-application-bootstrap

© majiayu000, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/bash/bash-script-template of majiayu000/claude-skill-registry.

  • SKILL.md
  • metadata.json

Open the folder on GitHubat commit 2d14a69

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in majiayu000/claude-skill-registry, which our catalogue first saw on October 8, 2026.

Compare with similar skills

Bash Script Template next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Bash Script Template compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Bash Script Template this skillmajiayu000/claude-skill-registry6661 repos~983Automated safety check: NotesMIT
Mole Bug Patternstw93/Mole70k—~2kAutomated safety check: PassGPL-3.0
CLI DeveloperJeffallan/claude-skills12k2 repos~1.2kAutomated safety check: PassMIT
JSON Processing with jqcharmbracelet/crush29k—~746Automated safety check: PassCustom licence
Shellm Architecture Referencelaude-institute/headlong1.2k—~2kAutomated safety check: NotesApache-2.0
Bash Scriptingpromovaweb/setupvibe1015 repos~1.2kAutomated safety check: PassGPL-3.0

Similar skills

  • A catalog of recurring bug shapes in the Mole Mac cleaner, used to review safety-sensitive diffs for deletion safety, unbounded commands, shell traps and weak tests.

    70k GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 2 repos~1.2k tokens
    DevelopmentAuto-check passed
  • JSON Processing with jq

    charmbracelet/crush

    Explains the jq command built into Crush for querying, filtering and reshaping JSON, including its supported flags and where it differs from standard jq.

    29k GitHub stars~746 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Shellm Architecture Reference

    laude-institute/headlong

    Explains how shellm's bash-based recursive LLM shell fits together - its core engine, identity system, memory, skills and trajectory log.

    1.2k GitHub stars~2k tokensUpdated yesterday
    DevelopmentAuto-check: notes
  • Bash Scripting

    promovaweb/setupvibe

    Bash scripting workflow for creating production-ready shell scripts with defensive patterns, error handling, and testing.

    101 GitHub starsUsed in 5 repos~1.2k tokens
    DevelopmentAuto-check passed
  • Cpp

    crazyguitar/cppcheatsheet

    Comprehensive C/C++ programming reference covering everything from C11-C23 and C++11-C++23, system programming, CUDA GPU computing, debugging tools, Rust interop, and advanced topics.

    290 GitHub stars~1.8k tokensUpdated yesterday
    DevelopmentAuto-check passed

More from majiayu000/claude-skill-registry

All 1,273 skills in this repo
  • Deep Research

    majiayu000/claude-skill-registry

    Multi-source deep research using firecrawl and exa MCPs. An agent skill from majiayu000/claude-skill-registry.

    666 GitHub starsUsed in 6 repos~1.1k tokens
    Auto-check passed
  • Exa Search

    majiayu000/claude-skill-registry

    Neural search via Exa MCP for web, code, and company research.

    666 GitHub starsUsed in 5 repos~856 tokens
    Auto-check passed
  • Fal AI Media

    majiayu000/claude-skill-registry

    Unified media generation via fal.ai MCP — image, video, and audio.

    666 GitHub starsUsed in 5 repos~1.7k tokens
    Auto-check passed
  • Pyzotero

    majiayu000/claude-skill-registry

    Interact with Zotero reference management libraries using the pyzotero Python client.

    666 GitHub starsUsed in 5 repos~1.6k tokens
    Auto-check: notes
  • Bgpt Paper Search

    majiayu000/claude-skill-registry

    Search scientific papers and retrieve structured experimental data extracted from full-text studies via the BGPT MCP server.

    666 GitHub starsUsed in 4 repos~619 tokens
    Auto-check: notes
  • Bio Alignment Pairwise

    majiayu000/claude-skill-registry

    Perform pairwise sequence alignment using Biopython Bio.Align.PairwiseAligner.

    666 GitHub starsUsed in 4 repos~1.7k tokens
    Auto-check passed

Works with

Categories

Questions about Bash Script Template

What does Bash Script Template do?

Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations. Bash Script Template is an agent skill from majiayu000/claude-skill-registry. Generate bash script templates with best practices including error handling, argument parsing, logging, and portability considerations.

When should I use Bash Script Template?

Bash Script Template fits situations like: tasks that involve Shell scripting.

How do I install Bash Script Template in Claude Code?

Run `npx skills add majiayu000/claude-skill-registry --skill bash-script-template -a claude-code`. Or copy the skill folder (skills/bash/bash-script-template in majiayu000/claude-skill-registry) into .claude/skills/bash-script-template in your project. Claude Code loads it when a task matches its description.

How do I install Bash Script Template in Codex?

Run `npx skills add majiayu000/claude-skill-registry --skill bash-script-template -a codex`. Or copy the skill folder (skills/bash/bash-script-template in majiayu000/claude-skill-registry) into .agents/skills/bash-script-template in your project. Codex loads it when a task matches its description.

Can I use Bash Script Template in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add majiayu000/claude-skill-registry --skill bash-script-template -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bash-script-template, .gemini/skills/bash-script-template, .github/skills/bash-script-template and .opencode/skills/bash-script-template in your project.

What does Bash Script Template need to run?

SKILL.md names no scripts, command-line tools or credentials: Bash Script Template is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep.

Does Bash Script Template access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Bash Script Template safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Bash Script Template use?

Bash Script Template is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Bash Script Template use?

About 983 tokens (SKILL.md is roughly 3.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Bash Script Template?

Skills that share tags, products or a category with Bash Script Template: Mole Bug Patterns (tw93/Mole, 70k stars), CLI Developer (Jeffallan/claude-skills, 12k stars), JSON Processing with jq (charmbracelet/crush, 29k stars) and Shellm Architecture Reference (laude-institute/headlong, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Bash Script Template?

majiayu000 (a GitHub user) maintains it in majiayu000/claude-skill-registry, which has 666 GitHub stars. The repository holds 1,273 skills in this directory. The repository was last updated on October 7, 2026.

Source: majiayu000/claude-skill-registry on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.