# Format shell scripts into a stable house style before review with shfmt

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

- Skill: `agentskillexchange/format-shell-scripts-into-a-stable-house-style-before-review` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/format-shell-scripts-into-a-stable-house-style-before-review`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/format-shell-scripts-into-a-stable-house-style-before-review/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/format-shell-scripts-into-a-stable-house-style-before-review

---


# Format shell scripts into a stable house style before review with shfmt

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:
- To parse shell scripts, inspect them, and print them out,
- see the [syntax package](https://pkg.go.dev/mvdan.cc/sh/v3/syntax).
- For high-level operations like performing shell expansions on strings,

- Source: https://github.com/mvdan/sh
- Extracted from upstream docs: https://raw.githubusercontent.com/mvdan/sh/HEAD/README.md

## Documentation

- https://pkg.go.dev/mvdan.cc/sh/v3

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/format-shell-scripts-into-a-stable-house-style-before-review-with-shfmt/)

