Linter, formatter and pre-commit hook setup for a team repository
Sets up consistent code style for a team repository: picks a linter and formatter for the language, writes the config files, adds pre-commit hooks and a CI check, and plans how to introduce it without one giant noisy commit. Use it when code reviews keep arguing about formatting or new joiners write in different styles.
The output this prompt produced, unedited.
The prompt
Layer 1: the project
Languages and frameworks: [e.g. TypeScript with React, Python with Django, PHP]
Package manager: [e.g. npm, pnpm, pip, Composer]
Current style tools, if any: [list, or none]
Team size and editors used: [e.g. 6 developers, mostly one popular code editor]
CI system: [e.g. a hosted CI with YAML workflows]
Repository size: [e.g. 900 files]
Layer 2: the decisions
Choose one formatter and one linter per language, the most widely used for that language, and say why in one line each.
Let the formatter own formatting and turn off every linter rule that conflicts with it.
Start from the recommended rule set and add no more than five rules, each catching a real bug class.
Run hooks only on staged files so commits stay fast.
Layer 3: the files and rollout
Every config file in its own code block with its file name: linter, formatter, ignore files, editor config, and the hook config.
The install commands, in order.
A CI job that fails the build on lint errors and unformatted files.
Editor settings so format on save matches the CI check.
Rollout plan: one commit that only reformats the whole codebase, its hash added to the blame ignore file, then the hooks switched on.
A short section for the README: how to run the checks and how to fix a failing hook.
Rules
Do not tell anyone to skip hooks as a normal step.
Keep config small; explain any rule that is turned off.
Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.
The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.