shellcheck-configuration

Analyze shell scripts with ShellCheck and configure linting rules.

1|Updated Jun 18, 2025
One-click install
npx skills add https://github.com/knopki/dotfiles --skill shellcheck-configuration-knopki
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shellcheck-configuration
Source: https://github.com/knopki/dotfiles/tree/main/home/private_dot_config/opencode/skills/shellcheck-configuration
Command: npx skills add https://github.com/knopki/dotfiles --skill shellcheck-configuration-knopki

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of writing robust, portable, and error-free shell scripts by leveraging ShellCheck for static analysis, identifying common pitfalls, and enforcing best practices.

Core Features & Use Cases

  • Static Analysis: Detects common errors, warnings, and style issues in shell scripts.
  • Configuration Management: Guides users on setting up .shellcheckrc files and environment variables for project-specific linting rules.
  • Error Code Explanation: Provides detailed explanations and fixes for numerous ShellCheck error codes (e.g., SC2086, SC2181).
  • Integration: Demonstrates integration with pre-commit hooks, GitHub Actions, and GitLab CI.
  • Use Case: Ensure all shell scripts in your project adhere to a consistent quality standard before they are merged into the main branch by integrating ShellCheck into your CI/CD pipeline.

Quick Start

Use the shellcheck-configuration skill to analyze the script '/path/to/your/script.sh' for potential issues.

Frequently Asked Questions about shellcheck-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I integrate shellcheck into a CI/CD pipeline?

You can integrate shellcheck into CI/CD pipelines by configuring it within GitHub Actions, GitLab CI, or pre-commit hooks to automatically analyze shell scripts for errors and enforce quality standards before merging code.

What does the shellcheck error code SC2086 mean and how do I fix it?

Shellcheck error codes like SC2086 indicate specific problematic patterns in shell scripts. This configuration provides detailed explanations for these warnings and offers practical examples to help you fix quoting and variable expansion issues.

Can I use shellcheck for scripting dialects other than Bash?

Yes, shellcheck static analysis supports multiple shell scripting dialects. You can analyze scripts written in Bash, sh, dash, and ksh to detect common errors, improve script quality, and ensure portability across different environments.

How do I configure shellcheck rules and suppress specific warnings?

You can configure shellcheck rules and suppress specific warnings by setting up a `.shellcheckrc` file or using environment variables. This allows you to define project-specific linting rules tailored to your development workflow.

What is the best way to check shell scripts for common errors before committing?

The best way to check shell scripts before committing is to integrate shellcheck static analysis using pre-commit hooks. This detects common pitfalls, style issues, and problematic patterns early in your development workflow.

Why does shellcheck report style issues in my shell script?

Shellcheck reports style issues to enforce best practices and identify problematic patterns in shell scripting. By analyzing your scripts statically, it highlights areas where portability and robustness can be improved through configuration and error code fixes.