Compétences shellcheck-configuration
🐚

shellcheck-configuration

Sûr 🌐 Accès réseau⚙️ Commandes externes📁 Accès au système de fichiers

配置 ShellCheck 以實現可靠的 Shell 靜態分析

Shell 指令碼問題隱藏到正式環境才浮現,拖慢程式碼審查。本技能說明 ShellCheck 的設定、規則配置和整合工作流程,協助您在合併前發現問題。

Prend en charge: Claude Codex Code(CC)
📊 71 Adéquat
1

Télécharger le ZIP du skill

2

Importer dans Claude

Allez dans Paramètres → Capacités → Skills → Importer un skill

3

Activez et commencez à utiliser

Tester

Utilisation de "shellcheck-configuration". I need help understanding SC2086 and how to fix it

Résultat attendu:

  • SC2086 是未引用變數展開警告
  • 透過引用變數或使用陣列語法來修正
  • 範例:將 'for i in $list' 改為 'for i in "$list"' 或 'for i in "${list[@]}"'

Utilisation de "shellcheck-configuration". Create a .shellcheckrc for a Bash project

Résultat attendu:

  • 設定 shell=bash 進行 Bash 方言分析
  • 啟用可選檢查,例如 require-variable-braces
  • 停用 SC1091 針對可能不存在的已載入檔案
  • 為每個停用的代碼加上註解,說明停用原因

Audit de sécurité

Sûr
v4 • 1/17/2026

Pure documentation skill containing only markdown guidance for ShellCheck, a legitimate open-source static analysis tool. All static findings are false positives. References like SC2009, SC2086 are ShellCheck error codes (not C2 keywords), sha256sum is appropriate for caching (not weak crypto), and shell examples are documentation (not malicious patterns).

2
Fichiers analysés
631
Lignes analysées
3
résultats
4
Total des audits

Score de qualité

38
Architecture
100
Maintenabilité
85
Contenu
32
Communauté
100
Sécurité
91
Conformité aux spécifications

Ce que vous pouvez construire

新增 CI shell 靜態分析

在 CI Pipeline 中設定 ShellCheck,使用一致的標誌和失敗規則。

修正常見警告

了解關鍵的 ShellCheck 代碼,並應用更安全的引用和流程模式。

標準化靜態分析規則

定義共用的 .shellcheckrc 設定和已記錄的隱藏原則。

Essayez ces prompts

開始使用
說明如何安裝 ShellCheck 並對單一指令碼執行它。包括在 Ubuntu 上安裝的範例命令,以及對 Bash 檔案執行檢查的範例。
專案配置
為 Bash 指令碼起草一個 .shellcheckrc,啟用一些檢查並停用兩個代碼。說明每個設定。
CI 整合
提供一個最小的 GitHub Actions 步驟,安裝 ShellCheck 並對所有 .sh 檔案執行檢查,在出現警告時失敗。
隱藏警告
展示如何在 Shell 指令碼中隱藏 SC1091 和 SC2119,並記錄每個隱藏為何是安全的。

Bonnes pratiques

  • 在靜態分析前明確設定目標 Shell,以符合您的部署環境
  • 為每個隱藏的代碼加上註解,說明理由
  • 在 pre-commit 勾子和 CI 中執行 ShellCheck,以實現早期本地和遠端偵測

Éviter

  • 廣泛停用警告,而不對每個代碼提供具體理由
  • 將 Bash 指令碼當作 POSIX sh 靜態分析,而不了解相容性需求
  • 忽略 CI 中的 ShellCheck 失敗或覆蓋退出碼而不進行審查

Foire aux questions

這與 Bash 和 POSIX sh 相容嗎?
是的。它涵蓋 Bash 和 POSIX sh 設定,並顯示如何明確設定目標 Shell 方言。
此技能的限制是什麼?
它僅提供指導,不執行 ShellCheck 或修改您儲存庫中的檔案。
它可以與 CI 系統整合嗎?
是的。它包含 GitHub Actions、GitLab CI 和 pre-commit 勾子整合的範例。
它會存取我的檔案或憑證嗎?
不。它包含靜態文件,不會存取您的系統或憑證。
如果 ShellCheck 報告太多警告怎麼辦?
使用有針對性的隱藏,並記錄原因,制定團隊政策來審查排除的代碼。
它與一般靜態分析工具相比如何?
ShellCheck 專門針對 Shell 指令碼,能捕捉一般靜態分析工具遺漏的 Shell 特定問題。

Détails du développeur

Structure de fichiers

📄 SKILL.md