skill-missing-shebang
Shell script lacks shebang line
Rule Details
Shell scripts must start with a shebang line (e.g., #!/bin/bash or #!/usr/bin/env bash) to specify which interpreter should execute them. Without a shebang, the script may fail or run under an unexpected shell, leading to subtle bugs. This rule checks all .sh files within skill directories. This rule is auto-fixable and will prepend #!/usr/bin/env bash to scripts that lack a shebang.
Incorrect
Shell script without shebang
echo "Hello, world!"
exit 0Correct
Shell script with env shebang
#!/usr/bin/env bash
echo "Hello, world!"
exit 0Shell script with direct bash path
#!/bin/bash
echo "Hello, world!"
exit 0How To Fix
Add a shebang line as the very first line of your shell script. The recommended shebang is #!/usr/bin/env bash for portability. Alternatively, run the auto-fixer which will prepend it automatically.
Options
This rule does not have any configuration options.
Related Rules
Resources
Version
Available since: v0.2.0