Back to list
hoelzro

shell-scripting

by hoelzro

My dotfiles

9🍴 0📅 Jan 20, 2026

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-case is clearer than grep -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

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon