moai-lang-shell

kivo360's avatarfrom kivo360

Shell scripting best practices with bats-core 1.11, shellcheck 0.10, and POSIX compliance.

⭐0stars🔀0forks📁View on GitHub🕐Updated Dec 18, 2025

When & Why to Use This Skill

This Claude skill optimizes shell scripting workflows by enforcing POSIX compliance and industry best practices using ShellCheck 0.10 and bats-core 1.11. It helps developers build robust, portable, and high-quality Bash scripts through automated linting, Test-Driven Development (TDD) support, and strict adherence to the TRUST 5 quality principles.

Use Cases

  • Automated Static Analysis: Identifying syntax errors, security vulnerabilities, and non-portable code in shell scripts using the latest ShellCheck standards.
  • Unit Testing & TDD: Implementing and executing comprehensive test suites with bats-core to ensure script logic remains correct during development and refactoring.
  • POSIX Compliance Auditing: Ensuring shell scripts are compatible across various Unix-like systems by validating against POSIX standards.
  • Quality Gate Enforcement: Maintaining high code standards by requiring 85% test coverage and performing TRUST 5 compliance reviews before deployment.
  • Legacy Script Modernization: Migrating older shell scripts to modern standards (Bash 5.2+) while ensuring stability through automated testing.
namemoai-lang-shell
version2.0.0
created2025-10-22
updated2025-10-22
statusactive
descriptionShell scripting best practices with bats-core 1.11, shellcheck 0.10, and POSIX compliance.
keywords['shell', 'bash', 'shellcheck', 'bats', 'posix']

Lang Shell Skill

Skill Metadata

Field Value
Skill Name moai-lang-shell
Version 2.0.0 (2025-10-22)
Allowed tools Read (read_file), Bash (terminal)
Auto-load On demand when keywords detected
Tier Language

What It Does

Shell scripting best practices with bats-core 1.11, shellcheck 0.10, and POSIX compliance.

Key capabilities:

  • ✅ Best practices enforcement for language domain
  • ✅ TRUST 5 principles integration
  • ✅ Latest tool versions (2025-10-22)
  • ✅ TDD workflow support

When to Use

Automatic triggers:

  • Related code discussions and file patterns
  • SPEC implementation (/alfred:2-run)
  • Code review requests

Manual invocation:

  • Review code for TRUST 5 compliance
  • Design new features
  • Troubleshoot issues

Tool Version Matrix (2025-10-22)

Tool Version Purpose Status
Bash 5.2.37 Primary ✅ Current
ShellCheck 0.10.0 Primary ✅ Current
bats-core 1.11.0 Primary ✅ Current

Inputs

  • Language-specific source directories
  • Configuration files
  • Test suites and sample data

Outputs

  • Test/lint execution plan
  • TRUST 5 review checkpoints
  • Migration guidance

Failure Modes

  • When required tools are not installed
  • When dependencies are missing
  • When test coverage falls below 85%

Dependencies

  • Access to project files via Read/Bash tools
  • Integration with moai-foundation-langs for language detection
  • Integration with moai-foundation-trust for quality gates

References (Latest Documentation)

Documentation links updated 2025-10-22


Changelog

  • v2.0.0 (2025-10-22): Major update with latest tool versions, comprehensive best practices, TRUST 5 integration
  • v1.0.0 (2025-03-29): Initial Skill release

Works Well With

  • moai-foundation-trust (quality gates)
  • moai-alfred-code-reviewer (code review)
  • moai-essentials-debug (debugging support)

Best Practices

✅ DO:

  • Follow language best practices
  • Use latest stable tool versions
  • Maintain test coverage ≥85%
  • Document all public APIs

❌ DON'T:

  • Skip quality gates
  • Use deprecated tools
  • Ignore security warnings
  • Mix testing frameworks