AgentSkillsCN

shell-programming

当用户提出“编写 Shell 脚本”“创建 Bash 脚本”“修复 Shell 脚本”“审查 Shell 代码”“编写 Bash 函数”,或在实现任何 Shell/Bash 代码时,可使用此技能。该技能基于 Google Shell 风格指南,为您提供 Shell 脚本的最佳实践建议。

SKILL.md
--- frontmatter
name: shell-programming
description: This skill should be used when the user asks to "write a shell script", "create a bash script", "fix a shell script", "review shell code", "write a bash function", or when implementing any shell/bash code. Provides shell scripting best practices based on Google Shell Style Guide.

Shell Programming

Follow shell-style-guide.md for all formatting, naming, syntax, and documentation rules.

Tech Stack

  • Testing: Bats-core
  • Static analysis / linter: ShellCheck

General Rules

  • Always run health checks: static analysis, tests, make sure everything pass.
  • Requires shellcheck and bats installed. If not available, offer to install via Homebrew (ask user for confirmation first).

Run health checks:

bash
shellcheck script.sh
bats script.test.bats