From johnfink-skills
Use when (a) setting up a new project and choosing/configuring a formatter, (b) someone is proposing a manual formatting override or arguing about style, (c) reformatting legacy code or deciding whether to bundle reformatting with unrelated changes, (d) deciding line-length / import-order / quote-style / trailing-comma config, or (e) adding pre-commit hooks or editor config (`.editorconfig`). NOT needed for ordinary code edits — modern formatters already handle those, and the principle is "let the formatter decide" which only matters when a decision is actually being made.
How this skill is triggered — by the user, by Claude, or both
Slash command
/johnfink-skills:formatting-standardsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Draft — first poke.** Edit the rules below to match what you actually want.
Draft — first poke. Edit the rules below to match what you actually want.
Formatting is a solved problem. The only correct amount of time to spend thinking about it is zero.
If a file has a configured formatter (ruff, black, prettier, gofmt, rustfmt, etc.), the formatter decides. Not your aesthetic preference, not the surrounding code's style, not "what looks cleaner here." Run the formatter and commit what it produces.
If the formatter and your taste disagree, the formatter wins.
Pick one per language and stick with it:
ruff format (also handles linting via ruff check). Replaces black + isort + flake8.prettier for formatting, eslint for linting. Keep them in separate concerns.gofmt / goimports. No discussion.rustfmt with defaults.shfmt -i 2.prettier.For any new project: install the formatter, add the config file, wire it to pre-commit and editor-on-save. Day one.
ruff line-length 100.prettier printWidth 100.88 (black default) is too narrow for modern monitors. 120 is too wide for side-by-side diffs. 100 is the right answer.
ruff sorts imports (I rule), three groups (stdlib / third-party / first-party).Never reorder imports by hand. If the tool's order is "wrong," the tool is right.
Multi-line literals/arguments get trailing commas. They make diffs cleaner (adding an item touches one line instead of two) and they prevent merge conflicts. Every modern formatter does this by default — don't disable it.
When editing a file with inconsistent legacy formatting, format only the lines you're already touching, OR run the formatter on the whole file as a separate commit. Mixing "fix bug" with "reformat 400 lines" makes the diff unreviewable.
A .editorconfig at the repo root covers indentation, line endings, trailing whitespace, and final newlines for all the editors in the world without needing per-editor config. Cheap insurance.
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.py]
indent_size = 4
[Makefile]
indent_style = tab
Format-on-save catches 95%. Pre-commit hook catches the rest. Pre-push is too late — by then the unformatted code is in your history. CI as the final backstop.
These are settled — do not relitigate per-project:
If someone wants to argue, point them at the formatter config.
npx claudepluginhub johnfink8/skill-repo --plugin johnfink-skillsProvides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.