shell-workflow

Lint and format Bash and POSIX shell scripts with shellcheck and shfmt.

Updated Apr 11, 2023
One-click install
npx skills add https://github.com/salverius-tech/dotfiles --skill shell-workflow
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-workflow
Source: https://github.com/salverius-tech/dotfiles/tree/main/home/dot_claude/skills/shell-workflow
Command: npx skills add https://github.com/salverius-tech/dotfiles --skill shell-workflow

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidelines and tools to write robust, maintainable, and portable shell scripts, preventing common errors and improving code quality.

Core Features & Use Cases

  • Linting & Formatting: Ensures scripts adhere to style guides and are free of syntax errors using tools like shellcheck and shfmt.
  • Best Practices: Enforces strict mode, proper variable quoting, naming conventions, and error handling.
  • Portability: Guides on writing POSIX-compliant scripts versus Bash-specific features.
  • Use Case: When developing a new deployment script, use this Skill to ensure it's well-formatted, error-checked, and follows established best practices before merging.

Quick Start

Activate the shell-workflow skill to lint all .sh files in the current directory.

Frequently Asked Questions about shell-workflow

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

FAQPage Schema
How do I enforce best practices for shell scripting in my automation projects?

To enforce shell scripting best practices, you can use this Skill to standardize Bash and POSIX shell development through strict mode, proper variable quoting, and naming conventions. It prevents common errors and improves code maintainability.

What is the best way to lint and format Bash scripts?

The best way to lint and format Bash scripts is by applying this Skill's guidelines, which utilize tools like shellcheck and shfmt. This ensures your scripts adhere to style guides and remain free of syntax errors.

How do I make my Bash scripts portable and POSIX compliant?

To make Bash scripts portable, this Skill guides you on writing POSIX-compliant scripts versus using Bash-specific features. This ensures your shell automation runs reliably across different environments.

Why does my shell script fail silently without throwing an error?

Shell scripts often fail silently without strict mode enforcement and proper error handling. This Skill helps you implement strict mode and robust variable handling to catch and prevent these common scripting pitfalls.

Do I need any dependencies to use shellcheck and shfmt for script linting?

No specific dependencies are required to use this Skill's guidelines for shellcheck and shfmt. It provides the reference rules to standardize your shell scripts directly within your current development workflow.

How do I test shell automation scripts before merging them?

To test shell automation scripts before merging, this Skill addresses testing alongside formatting and error-checking. It facilitates the creation of reliable scripts by ensuring they follow established best practices.