本文へスキップ
Skillpedia
一般的なプログラミング48k · #4014

bash-defensive-patterns

できること

このツールは、より安全で信頼性の高いコマンドラインスクリプト(Bash)を書くのに役立ちます。よくある間違いを避け、予期しない状況でもスクリプトが正しく動くようにする方法を学べます。

使う場面

  • ✓パソコンの作業を自動化するスクリプトを作るとき。
  • ✓サーバーやクラウド上で動作するツールを作るとき。
  • ✓スクリプトを堅牢にし、簡単に失敗しないようにしたいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bash-defensive-patterns/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/bash-defensive-patterns/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ファイルを削除する前に、そのファイルが存在するかを確認するBashスクリプトは、どのように書けばよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

このツールは、実行しようとしている操作をチェックすること、スクリプトが受け取る情報が正しいことを確認すること、エラーを報告するように設定することなどの方法を提案します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Bash Defensive Patterns

Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.

Use this skill when

  • Writing production automation scripts
  • Building CI/CD pipeline scripts
  • Creating system administration utilities
  • Developing error-resilient deployment automation
  • Writing scripts that must handle edge cases safely
  • Building maintainable shell script libraries
  • Implementing comprehensive logging and monitoring
  • Creating scripts that must work across different platforms

Do not use this skill when

  • You need a single ad-hoc shell command, not a script
  • The target environment requires strict POSIX sh only
  • The task is unrelated to shell scripting or automation

Instructions

  1. Confirm the target shell, OS, and execution environment.
  2. Enable strict mode and safe defaults from the start.
  3. Validate inputs, quote variables, and handle files safely.
  4. Add logging, error traps, and basic tests.

Safety

  • Avoid destructive commands without confirmation or dry-run flags.
  • Do not run scripts as root unless strictly required.

Refer to resources/implementation-playbook.md for detailed patterns, checklists, and templates.

Resources

  • resources/implementation-playbook.md for detailed patterns, checklists, and templates.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

「Bashスクリプト」とは何ですか?

コンピューターに自動的に作業をさせるために書く、コマンドの小さなまとまりのことです。

なぜ「防御的なスクリプト」が必要なのですか?

スクリプトが誤って重要なファイルを削除したり、予期せず停止したりするといった、意図しないトラブルを防ぐためです。

このツールが代わりにスクリプトを書いてくれますか?

いいえ、より良く安全なスクリプトを自分で書けるように、ベストプラクティスを教えるツールです。

詳細

作者による元の説明

Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4014
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル