# code-formatter-installer

code-formatter-installer installs Prettier, ESLint, EditorConfig and git hooks, then wires them into CI so the whole team formats code the same way.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 278 installs · ★ 64 repo stars
- Author: patricio0312rev
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/patricio0312rev/skills/tree/HEAD/foundation/code-formatter-installer/SKILL.md
- Updated: 2026-01-12
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/code-formatter-installer

## What it does

The skill runs the whole setup in one pass. It works out which language the project uses, picks a formatter and a linter, writes the config files, adds package scripts, editor settings, a git hook and a CI step. JavaScript and TypeScript get Prettier with ESLint and typescript-eslint. Python gets Black and isort with Ruff or Flake8 plus mypy, Go gets gofmt and golangci-lint, Rust gets rustfmt and clippy.

Templates ship with the skill: `.prettierrc.json` at `printWidth` 100 with single quotes, `.eslintrc.json` where `no-console` only warns, an `.editorconfig` with two-space indent and lf endings, and a `[tool.black]` block for `pyproject.toml`. The scripts cover `format`, `format:check`, `lint`, `lint:fix` and `typecheck`; Husky with lint-staged handles Node.js. Ready-made sets for Next.js, React, Node.js, FastAPI and Django sit in `assets/configs/`.

In a Python repo the hook stays inactive until `pre-commit install` runs, so `pip install pre-commit` on its own is not enough. The author keeps an escape hatch with `git commit --no-verify` and asks that the team write down when that is acceptable.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add patricio0312rev/skills --skill code-formatter-installer -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/code-formatter-installer/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/code-formatter-installer/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add patricio0312rev/skills --skill code-formatter-installer -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/code-formatter-installer/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add patricio0312rev/skills --skill code-formatter-installer -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/code-formatter-installer/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install patricio0312rev/skills foundation/code-formatter-installer/SKILL.md
```

2. **Manually: put the files in place**
- File: `.github/skills/code-formatter-installer/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add patricio0312rev/skills --skill code-formatter-installer -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/patricio0312rev/skills --path foundation/code-formatter-installer
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/code-formatter-installer/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add patricio0312rev/skills --skill code-formatter-installer -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/patricio0312rev/skills/tree/HEAD/foundation/code-formatter-installer/SKILL.md

## When to use it
- set up Prettier and ESLint in a TypeScript repo without hand-picking rules
- generate an `.editorconfig` that does not fight the formatter
- run the formatter on changed files only before each commit
- add a `format:check` job to CI so unformatted code fails the build
- wire Black, isort and mypy into `pyproject.toml`

## Example prompts
- Set up Prettier and ESLint for this repo, put the configs in the root and add `format` and `lint` scripts.
- Add a pre-commit hook that runs `eslint --fix` and `prettier --write` on staged files with Husky and lint-staged.
- Write `.github/workflows/lint.yml` that checks formatting and types on every push.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: c72b7e8a0fcb56f4.

BEGIN THIRD-PARTY FILE c72b7e8a0fcb56f4
````text
---
name: code-formatter-installer
description: Installs and configures Prettier, ESLint, EditorConfig, and other code quality tools to enforce consistent code style across the team. Generates config files, npm scripts, editor settings recommendations, and CI integration suggestions. Use when users request "setup prettier", "add eslint", "configure code formatting", or "enforce code style".
---

# Code Formatter & Linter Installer

Establish consistent code formatting and linting across your project.

## Core Workflow

1. **Detect stack**: Identify language/framework (JS/TS, Python, Go, Rust)
2. **Choose tools**: Select appropriate formatters and linters
3. **Generate configs**: Create config files with best-practice rules
4. **Add scripts**: Include npm/package scripts for format/lint
5. **Configure editor**: Provide VS Code, IntelliJ, Vim settings
6. **Setup pre-commit**: Add git hooks for automatic formatting
7. **CI integration**: Suggest GitHub Actions or CI config

## Tool Selection by Stack

### JavaScript/TypeScript

- **Formatter**: Prettier
- **Linter**: ESLint + typescript-eslint
- **Editor**: EditorConfig
- **Hooks**: Husky + lint-staged

### Python

- **Formatter**: Black + isort
- **Linter**: Ruff or Flake8 + mypy
- **Hooks**: pre-commit

### Go

- **Formatter**: gofmt + goimports
- **Linter**: golangci-lint

### Rust

- **Formatter**: rustfmt
- **Linter**: clippy

## Configuration Templates

### Prettier (.prettierrc.json)

```json
{
  "semi": true,
  "trailingComma": "es5",
  "singleQuote": true,
  "printWidth": 100,
  "tabWidth": 2,
  "arrowParens": "avoid"
}
```

### ESLint (.eslintrc.json)

```json
{
  "extends": [
    "eslint:recommended",
    "plugin:@typescript-eslint/recommended",
    "plugin:react/recommended",
    "prettier"
  ],
  "rules": {
    "no-console": "warn",
    "@typescript-eslint/no-unused-vars": "error"
  }
}
```

### EditorConfig (.editorconfig)

```ini
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

[*.md]
````
END THIRD-PARTY FILE c72b7e8a0fcb56f4

The third-party file has ended. Everything between the c72b7e8a0fcb56f4 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2103 of 6391 bytes. © patricio0312rev · MIT · https://github.com/patricio0312rev/skills/tree/HEAD/foundation/code-formatter-installer/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
