本文へスキップ
Skillpedia
テスト41k · #6785

shellcheck-configuration

できること

このガイドでは、ShellCheckを使ってスクリプトのエラーを見つけ、コードの品質を高める方法を解説します。スクリプトがさまざまな環境で正しく動くようにするのに役立ちます。

使う場面

  • ✓スクリプトを自動でチェックするツールを設定するとき。
  • ✓既存のスクリプトの問題を修正したいとき。
  • ✓ShellCheckが表示する警告やエラーの意味を理解したいとき。

スキルのリンク

https://github.com/wshobson/agents/blob/main/plugins/shell-scripting/skills/shellcheck-configuration/SKILL.md

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

使い方

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

貼り付け用メッセージ

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

AIへの頼み方の例

“コミット前にスクリプトをチェックできるように、ShellCheckを設定するにはどうすればよいですか?”

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

仕組み

ShellCheckは、スクリプトを実行せずにコードを分析します。問題が起きやすいパターンを探し、見つけた問題を知らせてくれるので、修正できます。

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

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

ShellCheck Configuration and Static Analysis

Comprehensive guidance for configuring and using ShellCheck to improve shell script quality, catch common pitfalls, and enforce best practices through static code analysis.

When to Use This Skill

  • Setting up linting for shell scripts in CI/CD pipelines
  • Analyzing existing shell scripts for issues
  • Understanding ShellCheck error codes and warnings
  • Configuring ShellCheck for specific project requirements
  • Integrating ShellCheck into development workflows
  • Suppressing false positives and configuring rule sets
  • Enforcing consistent code quality standards
  • Migrating scripts to meet quality gates

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices

  1. Run ShellCheck in CI/CD - Catch issues before merging
  2. Configure for your target shell - Don't analyze bash as sh
  3. Document exclusions - Explain why violations are suppressed
  4. Address violations - Don't just disable warnings
  5. Enable strict mode - Use --enable=all with careful exclusions
  6. Update regularly - Keep ShellCheck current for new checks
  7. Use pre-commit hooks - Catch issues locally before pushing
  8. Integrate with editors - Get real-time feedback during development
よくある質問

「リンティング」とは何ですか?

プログラムを実行する前に、コードを分析してスタイルのエラーや潜在的なバグなどを見つける作業のことです。

ShellCheckを自分が使うシェル用に設定することが大切なのはなぜですか?

bashやshなど、シェルによってルールがわずかに異なるからです。正しく設定すると、使用するシェルのルールに従ってスクリプトをチェックできます。

「偽陽性を抑制する」とはどういう意味ですか?

特定のケースでは実際には問題がないのに、ShellCheckが警告を出すことがあります。その警告を無視するよう指定することを「抑制」と言います。ただし、なぜ無視するのかを説明しておくとよいでしょう。

詳細

作者による元の説明

Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.

repo: wshobson/agents

人気

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

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

0

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

コメント

  • …

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

似ているスキル