shfmtshell

shfmt style normalization: standardize formatting of Bash, POSIX shell, and Zsh scripts before review or CI so style noise does not hide real changes.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "shfmtshell" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-cac6d56f46c3cae1b067d7b4ec7c6b2c73ada09c99dfc643c96afc2c4c3abaaf. Verify the upstream source and version against https://skillhub.cn/skills/user_3c6cb52e/format-shell-scripts-into-a-stable-house-style-before-review-with-shfmt before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

shfmt style normalization: standardize formatting of Bash, POSIX shell, and Zsh scripts before review or CI so style noise does not hide real changes.

0 Downloads

Introduction source: third_party · user_3c6cb52e · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Not specified in the source documentation.
Inputs and outputs
Not specified in the source documentation.
Software, accounts and paid services
Go or packaged shfmt binary, shell script files, optional CI or pre-commit integration
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: "使用 shfmt 在审查前将 shell 脚本格式化为稳定的房屋风格"
slug: "format-shell-scripts-into-a-stable-house-style-before-review-with-shfmt"
version: "1.0.0"
displayName: "使用 shfmt 在审查前将 shell 脚本格式化为稳定的房屋风格"
summary: "在审查或CI之前标准化Bash、POSIX shell和Zsh脚本,以便样式噪声不再隐藏真正的更改。"
license: "MIT"
description: "在审查或CI之前标准化Bash、POSIX shell和Zsh脚本,以便样式噪声不再隐藏真正的更改。"
github_stars: 8700
verification: "security_reviewed"
source: "https://github.com/1991513ccie-png/skills"
author: "1991513ccie-png"
publisher_type: "individual"
category: "Code Quality & Review"
framework: "Multi-Framework"
tool_ecosystem:
  github_repo: "1991513ccie-png/skills"
  github_stars: 8700

使用 shfmt 在审查前将 shell 脚本格式化为稳定的房屋风格

Normalize Bash, POSIX shell, and Zsh scripts before review or CI so style noise stops hiding the real changes.

Prerequisites

Go or packaged shfmt binary, shell script files, optional CI or pre-commit integration

Installation

Use the upstream install or setup path that matches your environment:

  • go install mvdan.cc/sh/v3/cmd/shfmt@latest
  • go install mvdan.cc/sh/v3/cmd/gosh@latest
  • docker build -t my:tag -f cmd/shfmt/Dockerfile .
  • docker run --rm -u "$(id -u):$(id -g)" -v "$PWD:/mnt" -w /mnt my:tag <shfmt arguments>

Requirements and caveats from upstream:

  • Supports [POSIX Shell], [Bash], [Zsh], and [mksh]. Requires Go 1.25 or later.
  • Packages are available on [Alpine], [Arch], [Debian], [Docker], [Fedora], [FreeBSD],
  • Docker

Basic usage or getting-started notes:

Documentation

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 解决开发者代码审查中的实际痛点(样式噪声干扰)
  • 支持多种 shell 类型(Bash/POSIX/Zsh),适用性广
Trigger Precision85/100

Highlights

  • 触发描述清晰明确,覆盖核心使用场景
  • 边界定义良好,不易产生误触
Structure and Standards72/100

Areas to improve

  • 缺少完整使用示例 Reported severity: Minor

    文档提供了安装方法但未展示端到端的格式化命令示例及效果对比

    Recommendation: 补充一个完整的 shfmt 使用示例,包括格式化前后的脚本对比

Highlights

  • 文档结构清晰,章节划分合理
  • frontmatter 信息完整
Execution Reliability68/100

Areas to improve

  • 缺少异常处理和操作确认说明 Reported severity: Major

    未说明如何处理 Go 版本不兼容、文件权限等问题,且格式化操作不可逆但无确认机制提示

    Recommendation: 补充常见错误处理方案,并提醒用户在格式化前备份或确认文件

Highlights

  • 工具来源明确,提供多种安装路径
  • 引用了官方文档和上游资源
Evidence Verifiability (mean of the first four)76/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • github.com
  • pkg.go.dev
  • raw.githubusercontent.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Go or packaged shfmt binary, shell script files, optional CI or pre-commit integration

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.