# Code Formatter

> Apply repository-standard formatting to minimize diff noise and meet linter expectations.

- Skill: `pilinux/code-formatter` (Agent Skill)
- Install (CLI): `npx skillmds@latest add pilinux/code-formatter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/pilinux/code-formatter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: pilinux (https://skillmd.com/u/pilinux)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/pilinux/code-formatter

---


# Code Formatter

## When to Use

- After making code edits and before running linters/tests or opening a PR.

## Rules

- Prefer `go fmt ./...` for Go files; do not perform sweeping reformatting unless requested.
- Only format files you changed unless the user asks for a global reformat.
- Run `gofmt`/`goimports` where appropriate and include updated imports in the patch.

## Commands

- **Format:** `go fmt ./...` (or `gofmt -w .` when explicitly requested)
- **Verify:** `golangci-lint run --timeout 5m --verbose ./...` after formatting

## Output

- **Files formatted:** list of changed files.
- **Next:** recommended lint or test command.

## Related Skills

- `patch-applier`, `linter-runner`

