moai-lang-shell

Manage Git worktrees for parallel SPEC development with CLI commands.

1.2k|214|Updated Sep 16, 2025
One-click install
npx skills add https://github.com/modu-ai/moai-adk --skill moai-lang-shell
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-lang-shell
Source: https://github.com/modu-ai/moai-adk/tree/main/.claude/skills/moai-lang-shell
Command: npx skills add https://github.com/modu-ai/moai-adk --skill moai-lang-shell

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes examples (resource) and references (resource) components.

What problem does it solve?

Shell scripting can be error-prone and hard to maintain without proper standards. This Skill provides best practices for Bash scripting, integrating testing and linting tools to ensure your scripts are reliable, secure, and POSIX compliant.

Core Features & Use Cases

  • TDD for Shell: Implement test-driven development for shell scripts using bats-core 1.11.
  • Static Analysis: Automatically lint scripts with shellcheck 0.10 to catch common errors and security issues.
  • POSIX Compliance: Ensure scripts adhere to industry standards for portability and maintainability.
  • Use Case: When writing a new deployment script, this Skill can help you structure it correctly, add unit tests, and automatically check for syntax errors or potential vulnerabilities before execution.

Quick Start

Lint a shell script

shellcheck myscript.sh

Run tests for a shell script

bats tests/myscript.bats

Frequently Asked Questions about moai-lang-shell

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

FAQPage Schema
How do I write shell scripts that are POSIX compliant and avoid common errors?

POSIX compliant shell scripts ensure portability across systems. This Skill integrates shellcheck 0.10 for static analysis to catch syntax errors and security issues, plus bats-core 1.11 for test-driven development, helping you structure scripts correctly and validate them before execution.

Can I use test-driven development for bash scripts?

Yes. This Skill provides bats-core 1.11 for unit testing shell scripts, letting you write tests before implementation, catch regressions early, and maintain reliable deployment and automation scripts with confidence.

What's the best way to lint shell scripts for security and syntax issues?

Shellcheck 0.10 automatically lints shell scripts to detect common errors, potential vulnerabilities, and non-portable constructs. Running linting before execution prevents failures in production deployments and automation workflows.

How do I set up testing and linting for a new deployment script?

Structure your script with bats-core tests in a tests/ directory, then run shellcheck on the script to catch errors. This Skill combines both tools to validate syntax, security, and behavior end-to-end before deployment.

Why should I validate shell scripts before running them in production?

Static analysis with shellcheck catches portability issues and security flaws early; unit tests with bats verify behavior across edge cases. Together they prevent silent failures and downtime in production automation and deployment pipelines.