← スキル一覧に戻る

writing-shell-scripts
by cboone
Claude Code skills and hooks
⭐ 0🍴 0📅 2026年1月23日
SKILL.md
name: writing-shell-scripts description: >- Applies Bash style conventions when creating or editing shell scripts. Use when: (1) creating new shell scripts, (2) editing existing scripts in /bin/, or (3) reviewing Bash code for bugs or style issues.
Bash Style Guide
Apply the Bash conventions from ./references/BASH.md when creating or editing shell scripts.
Key Conventions
Read ./references/BASH.md for the complete guide. Summary:
Script Structure
- Shebang:
#!/usr/bin/env bash - Strict mode:
set -euo pipefail - Main function called at end:
main "${@}"
Naming
- Functions:
snake_case - Local variables:
lower_case - Constants:
ALL_CAPSwithreadonly
Syntax
- Variable expansion:
${var}not$var - Command substitution:
$(...)not backticks - Tests:
[[...]]not[...] - Function syntax:
function name() { }with both keyword and parentheses
Quoting
- Always quote variable expansions:
"${var}" - Always quote command substitutions:
"$(cmd)" - Use arrays for lists, not word splitting
Local Variables
- Declare with
local - Separate declaration from command substitution to preserve exit codes
Validation
Whenever possible, validate the script before finishing. Prefer using a project-specific validation script, if available. Common locations include declarations in package.json and scripts stored in bin/. If those aren't present, shellcheck is a commonly available linter for shell scripts.
スコア
総合スコア
65/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
✓最近の活動
1ヶ月以内に更新
+10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です
