kergoth/dotfiles/shell-script-style
Claude Code and agent skill by kergoth/dotfiles
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Apply Christopher Larson's preferred Bash and POSIX shell script style when creating or substantially editing user-facing shell scripts. Use when writing or modifying shell utilities under `scripts/` or `script/` (including extensionless shebang executables, pre-commit entry scripts, and CI helpers), `.sh` files, shell snippets intended for the user to keep, or any Bash or POSIX sh program that will become part of the maintained codebase. Do not use for temporary test scripts, disposable intermediate artifacts, or scripts written solely for AI-agent execution.
Install
npx vskill@latest install kergoth/dotfiles/shell-script-styleSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as kergoth/dotfiles/shell-script-style.
Shell Script Style
Overview
Use this skill to keep user-owned shell scripts aligned with the local shell style guide. Read the bundled reference before writing code, then apply the guide proportionally to the script's complexity.
Workflow
- Decide whether the script is user-facing. If it is a temporary harness, scratch file, or agent-only helper, skip this skill.
- Decide whether the script should be
bashor POSIXsh. Preferbashunless portability requirements clearly call forsh. - Read `references/shell-script-style-guide.md` before drafting or revising the script.
- If the script is a user-facing CLI tool (has flags, help text, or interactive output), invoke the
cli-designskill before writing code. - Apply the guide with judgment:
- Use the full structure for moderate or complex scripts.
- Keep genuinely tiny wrappers or filters minimal when the guide explicitly allows it.
- Skip
process_arguments()for scripts that only forward positional arguments (no switches/dry-run knobs) to another tool (e.g.,@/Users/kergoth/bin/list-chezmoi-repos) and, more generally, for “hello world”–style utilities that only consume arguments/produce output without any options to encode.
- Before finishing, verify the script still matches the guide's defaults for safety flags, formatting, argument parsing, messaging helpers, and dry-run or verbosity behavior where applicable.
Non-Negotiables
- Use
#!/usr/bin/env bashwithset -euo pipefailfor Bash scripts. - Use
#!/bin/shwithset -eufor POSIXshscripts. - In Bash scripts use
BASH_SOURCE[0](not$0) forscriptdirandscriptname; POSIXshscripts use$0. - Prefer
main()plusprocess_arguments()andusage()for non-trivial scripts. - Prefer
getopts, support-h, and include-n,-v, and-qwhen the script performs meaningful actions. - Use 4-space indentation, avoid dense one-liners, and keep comments minimal.
- Prefer
msg_*output helpers and arun()wrapper when the script benefits from dry-run or verbosity control.
Scope Boundary
Apply this skill when the output is meant to be read, run, or maintained by the user. Scripts committed to a repository under scripts/, .devcontainer/scripts/, or similar developer-tooling paths — including pre-commit helpers and CI utilities — are user-facing; apply this skill unless they are explicitly disposable or agent-only. Do not apply it to:
- throwaway reproduction scripts
- temporary test fixtures or harnesses
- one-off migration snippets embedded only in the current session
- agent-internal helper scripts that are not becoming part of the user's maintained files
When a shell task becomes complex enough that signal handling, data modeling, or cleanup semantics are getting brittle, prefer recommending Python instead of forcing the logic into shell.
Reference
The canonical guidance lives in `references/shell-script-style-guide.md`. Treat that file as the source of truth for detailed conventions and examples.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckinghome/dot_agents/skills/shell-script-style/SKILL.md
Popularity
- Repository stars
- 32
- Repository forks
- 1
- 7-day trend score
- 17
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 5 Sep 2026, 2 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kergoth/dotfiles/shell-script-style)