AGENT SKILL

Shell 脚本严格规范检查

lint-shell

在代码被接受之前应用严格的 shell 脚本工程规则。

License 许可
MIT
最近更新
2026-11-13
Stars
★ 65
Forks
0

01 前言 Front Matter

name
lint-shell
description
Apply strict shell-script engineering rules before code is accepted.

03 SKILL.md 正文

Procedure

  1. Identify the .sh/.bash files touched or under review.

  2. Apply the shell policy in rules/14-shell.mdc (agent-surface source; it may be rendered to the current host) together with the repository's configured linters and formatters: no unquoted variables, missing set -euo pipefail, or unchecked commands. If a constraint cannot be met, stop and name the blocker.

  3. Run the toolchain gate from rules/14-shell.mdc on each touched script:

    bash -n script.sh
    shellcheck -x script.sh
    shfmt -d script.sh
    
  4. Report each script in the format below.

Output

## <script-path>

Verdict: <BLOCKER | MAJOR | MINOR | CLEAN>

Findings:
- [severity] line N: description

Fix:
- concrete action per finding

Verification:
- bash -n: PASS/FAIL
- shellcheck: PASS/FAIL (error count)
- shfmt -d: PASS/FAIL

04 同仓库更多 Skills