shell-scripts

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Shell Scripts Workflow

Shell脚本工作流

Workflow for shell script changes.
Shell脚本变更的工作流。

Prerequisites

前提条件

  • Use
    git-workflow
    Skill
    for branch, commit, and PR workflow.
  • Refer to
    .claude/rules/shell-script.md
    for detailed best practices (SSOT).
  • 使用
    git-workflow
    Skill
    处理分支、提交和PR工作流。
  • 参考
    .claude/rules/shell-script.md
    获取详细最佳实践(SSOT)。

Applicable Files

适用文件

PathDescription
scripts/
All shell scripts
*.sh
Shell scripts anywhere
路径描述
scripts/
所有Shell脚本
*.sh
任意位置的Shell脚本

Workflow

工作流

1. Make Changes

1. 进行修改

Edit shell scripts following the rules in
.claude/rules/shell-script.md
.
按照
.claude/rules/shell-script.md
中的规则编辑Shell脚本。

2. Verify (from rules/shell-script.md)

2. 验证(来自rules/shell-script.md)

bash
make shfmt
shellcheck scripts/{script}.sh  # if installed
bash
make shfmt
shellcheck scripts/{script}.sh  # if installed

3. Self-Review Checklist

3. 自我检查清单

  • Script is executable (
    chmod +x
    )
  • Has shebang line (
    #!/usr/bin/env bash
    )
  • Uses strict mode (
    set -euo pipefail
    )
  • Variables are quoted
  • All comments and messages are in English
  • 脚本具备可执行权限(
    chmod +x
  • 包含shebang行(
    #!/usr/bin/env bash
  • 使用严格模式(
    set -euo pipefail
  • 变量已加引号
  • 所有注释和消息均为英文

Related

相关链接

  • .claude/rules/shell-script.md
    - Shell rules (SSOT)
  • git-workflow
    - Branch, commit, PR workflow
  • .claude/rules/shell-script.md
    - Shell规则(SSOT)
  • git-workflow
    - 分支、提交、PR工作流