AgentSkillsCN

shellcheck-configuration

掌握 ShellCheck 静态分析的配置与使用方法,提升 Shell 脚本的质量。适用于 linting 基础设施的搭建、代码问题的修复,或确保脚本的跨平台兼容性。

SKILL.md
--- frontmatter
version: 4.1.0-fractal
name: shellcheck-configuration
description: Master ShellCheck static analysis configuration and usage for shell script quality. Use when setting up linting infrastructure, fixing code issues, or ensuring script portability.

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.

Do not use this skill when

  • The task is unrelated to shellcheck configuration and static analysis
  • You need a different domain or tool outside this scope

Instructions

  • Clarify goals, constraints, and required inputs.
  • Apply relevant best practices and validate outcomes.
  • Provide actionable steps and verification.
  • If detailed examples are required, open resources/implementation-playbook.md.

Use this skill when

  • 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

ShellCheck Fundamentals

🧠 Knowledge Modules (Fractal Skills)

1. What is ShellCheck?

2. Installation

3. .shellcheckrc (Project Level)

4. Environment Variables

5. SC1000-1099: Parser Errors

6. SC2000-2099: Shell Issues

7. SC2100-2199: Quoting Issues

8. SC3000-3999: POSIX Compliance Issues

9. Minimal Configuration (Strict POSIX)

10. Development Configuration (Bash with Relaxed Rules)

11. CI/CD Integration Configuration

12. .shellcheckrc for Project

13. Pre-commit Hook Configuration

14. GitHub Actions Workflow

15. GitLab CI Pipeline

16. Suppressing Specific Warnings

17. Common Violations and Fixes

18. Checking Multiple Files

19. Caching Results

20. Default Format

21. GCC Format (for CI/CD)

22. JSON Format (for parsing)

23. Quiet Format