一键导入
shell
Google's official Shell scripting style guide. Covers Bash scripting, naming conventions, error handling, portability, and shell best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Google's official Shell scripting style guide. Covers Bash scripting, naming conventions, error handling, portability, and shell best practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Complete collection of Google's official style guides for 17 languages. Includes TypeScript, JavaScript, Python, Java, Go, C++, C#, Swift, Objective-C, HTML/CSS, AngularJS, Shell, R, Common Lisp, Vim Script, JSON, and Markdown. Production-ready coding standards used across Google's engineering organization, formatted for AI agent consumption.
Google's official AngularJS style guide. Covers controllers, services, directives, modules, dependency injection, and AngularJS 1.x best practices.
Google's official Common Lisp style guide. Covers naming conventions, formatting, macros, packages, documentation strings, and Lisp best practices.
Google's official C++ style guide. Covers headers, naming conventions, formatting, classes, memory management, RAII, smart pointers, and modern C++ features.
Google's official C# style guide. Covers naming conventions, formatting, LINQ, async/await, XML documentation, and .NET best practices.
Google's official Go style guide. Covers gofmt formatting, naming conventions, error handling, interfaces, concurrency patterns, and package organization. Enforces idiomatic Go code with short variable names and explicit error checks.
| name | shell |
| description | Google's official Shell scripting style guide. Covers Bash scripting, naming conventions, error handling, portability, and shell best practices. |
Official Google Shell scripting standards for consistent, maintainable Bash scripts.
#!/bin/bash — specify interpreter"$var" not $varset -e or explicit checksls — use globs or find[[ over [ — more features, fewer gotchas| Element | Convention | Example |
|---|---|---|
| Functions | lowercase_with_underscores | get_user_count |
| Variables | lowercase_with_underscores | user_count |
| Constants | UPPER_SNAKE_CASE | MAX_RETRIES |
| Environment vars | UPPER_SNAKE_CASE | PATH |
#!/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 "$@"
npx skills add testdino-hq/google-styleguides-skills/shell
See shell.md for complete details, examples, and edge cases.