Agent Wranglers

Structure Required

Format all code with one tool

Format every file with one automatic formatter, with its settings in the repository. Nobody formats by hand, and reviews never discuss layout.

How to do it

Pick the standard formatter for each language, such as Prettier for JavaScript, Ruff or Black for Python, gofmt for Go and PHP-CS-Fixer for PHP. Commit its settings file. Run it on save, in a pre-commit hook and in the build. Agents then see and copy one style.

Example

npx prettier --check .
ruff format --check .
vendor/bin/php-cs-fixer fix --dry-run --diff
test -z "$(gofmt -l .)"

How to check

The build runs the formatter in check mode and fails when it would change a file. Note that gofmt -l only lists files, so test that its output is empty.

For agents: if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in Based on the Agent Wranglers architecture playbook: https://agentwranglers.se/playbook/architecture/structure/one-formatter.