testdino-hq/google-styleguides-skills · Archived

shell

Google's official Shell scripting style guide. Covers Bash scripting, naming conventions, error handling, portability, and shell best practices.

First seen May 2, 2026

Installation

$ npx skills add testdino-hq/google-styleguides-skills --skill shell

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from testdino-hq/google-styleguides-skills · top by installs.

npx skills add testdino-hq/google-styleguides-skills

Browse all from testdino-hq/google-styleguides-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 9
License LICENSE
Default branch main
Open issues 0
Status Archived

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,730 B
  • docs SUMMARY.md 157 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 8 installs

SKILL.md

Google Shell Style Guide

Official Google Shell scripting standards for consistent, maintainable Bash scripts.

Quick Reference

Golden Rules

  1. Use #!/bin/bash — specify interpreter
  2. Quote variables — "$var" not $var
  3. Check exit codes — set -e or explicit checks
  4. Use functions — organize code logically
  5. Avoid parsing ls — use globs or find
  6. Use [[ over [ — more features, fewer gotchas
  7. ShellCheck for linting — catch common mistakes

Naming Conventions (Preview)

Element Convention Example
Functions lowercasewithunderscores getusercount
Variables lowercasewithunderscores user_count
Constants UPPERSNAKECASE MAX_RETRIES
Environment vars UPPERSNAKECASE PATH

Basic Patterns (Preview)

#!/bin/bash
# ✓ CORRECT

set -euo pipefail  # Exit on error, undefined vars, pipe failures

readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

function main() {
  local user_count="$1"
  
  if [[ -z "${user_count}" ]]; then
    echo "Error: user_count required" >&2
    return 1
  fi
  
  echo "Processing ${user_count} users"
}

main "$@"

When to Use This Guide

  • Writing new shell scripts
  • Refactoring existing scripts
  • Code reviews
  • Setting up ShellCheck
  • Onboarding new team members

Install

npx skills add testdino-hq/google-styleguides-skills/shell

Full Guide

See [shell.md](shell.md) for complete details, examples, and edge cases.