agentleFS
testdino-hqtestdino-hq/google-styleguides-skills/shell/SKILL.md

shell

Skill15 starsChanged 9 months agoMITView on GitHub

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

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use update-cli-config, migrate-to-skills and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • PandelisZSkill

    update-cli-config

    View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.

    Also in 7 projects that use this

  • 32103210Skill

    migrate-to-skills

    Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.

    Also in 7 projects that use this

  • 32103210Skill

    update-cursor-settings

    Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.

    Also in 7 projects that use this

  • 0mlkrizzz655335vSkill

    review-bugbot

    缺陷导向代码审查。用 Bugbot 子代理找 bug。

    Also in 4 projects that use this

  • 0mlkrizzz655335vSkill

    origin

    origin CLI 管理。安装、登录、更新、修复 origin.cursor.com 的 CLI。"disabled-environments:

    Also in 3 projects that use this

  • Tsumugii24Skill

    split-to-prs

    Split current work into small reviewable PRs. Use when the user asks to split a chat, set of changes, branch, or PR.

    Also in 6 projects that use this

  • +2 more from 32103210
  • +2 more from 0mlkrizzz655335v

The file

Files
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)

ElementConventionExample
Functionslowercase_with_underscoresget_user_count
Variableslowercase_with_underscoresuser_count
ConstantsUPPER_SNAKE_CASEMAX_RETRIES
Environment varsUPPER_SNAKE_CASEPATH

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 for complete details, examples, and edge cases.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.