← スキル一覧に戻る

shell-scripting
by hoelzro
My dotfiles
⭐ 9🍴 0📅 2026年1月20日
SKILL.md
name: shell-scripting description: Best practices for writing shell scripts. Use when writing bash, sh, zsh, or other shell code for automation, scripting, or command-line tasks.
Shell Scripting
Best Practices
Favor Long Options
When writing shell scripts, prefer long options (e.g., --verbose) over short options (e.g., -v) for improved readability and maintainability.
Why long options?
- Self-documenting:
grep --ignore-caseis clearer thangrep -i - Easier maintenance: Future readers understand intent without checking man pages
- Reduced errors: Less likely to misinterpret what a short flag does
Example:
# Good: Clear and self-documenting
find /var/log --name "*.log" --type f --mtime +30 --delete
# Avoid: Requires knowledge of what each flag means
find /var/log -name "*.log" -type f -mtime +30 -delete
Exception: Short options are acceptable for:
- Extremely common commands where the short form is universally understood (e.g.,
ls -la) - Interactive terminal usage where brevity matters
- Commands without long option equivalents
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です