agentleFS
farofyfarofy/ignite/skills/review/code-style/SKILL.md

code-style

Skill0 starsChanged 4 months agoApache-2.0View on GitHub

Keep formatting and lint consistent across a team and across languages by deferring to the project's own formatter and linter, and by setting up the language-standard tools plus a pre-commit hook and CI when none exist. A skill guides the agent, but the installed tools are what hold every human to the same style. Use when setting up formatting or linting, enforcing a consistent code style, before a first commit in a new repo, or when the user says "set up prettier", "add a formatter", "lint config", "format code", "code style", "định dạng code", "cài lint", "format cho dự án".

12 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debugging and testing.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 3 projects that use this

  • NVIDIASkill

    testing

    Run Python and Rust tests for physicsnemo-curator using uv + pytest with coverage reporting via pytest-cov, and cargo-nextest for Rust tests. Includes benchmark workflows with pytest-benchmark and criterion.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the repository first.

    line 20
  2. Distinctive:

    If tools already exist: run them, report the result, fix what they flag.

    line 35
  3. Distinctive:

    Never mix a reformat with a feature in one commit.

    line 190

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code style

Consistent style is enforced by tools, not by an agent reading rules. A formatter lays out code the same way every time. A linter rejects the rest. This skill makes sure those tools exist, are run, and are wired so every human on the team is held to them, and not the agent alone.

The project's own config is the source of truth. Detect it and follow it. Never impose a personal style over what the repository already sets.


1. Detect before doing anything

Read the repository first. One repo may hold several languages, so handle each.

SignalMeaning
.editorconfigCross-editor basics (indent, newline, charset). Honour it always
.gitattributesLine-ending policy (* text=auto eol=lf). Honour it always
.prettierrc, prettier in package.jsonJS/TS formatter present
.eslintrc*, eslint.config.*JS/TS linter present
[tool.ruff], [tool.black] in pyproject.toml, .flake8Python tools present
rustfmt.toml, clippy.tomlRust tools present
.clang-formatC/C++ formatter present
.golangci.ymlGo linter present (gofmt is built in)
.pre-commit-config.yamlA pre-commit manager is already wired
A format/lint script in the manifest or MakefileRun that, do not guess

If tools already exist: run them, report the result, fix what they flag. Do not replace a working setup with a different one because you prefer it.


2. Formatter and linter are different jobs

Both are needed for one shared style. Set up or run each.

LanguageFormatter (layout)Linter (rules)
JS, TSprettiereslint
Pythonruff format, or blackruff, or flake8
Gogofmt, gofumptgolangci-lint
Rustrustfmtclippy
Javagoogle-java-format, spotlesscheckstyle
Kotlinktlintktlint, detekt
C, C++clang-formatclang-tidy
Shellshfmtshellcheck

Pick the language's standard tool, not a niche one. When the ecosystem has a clear default (gofmt, rustfmt), there is no choice to make.


3. What a shared style pins down

Layout from section 2 is the start. A team style also fixes these, each one machine-checkable, so no reviewer has to police it by eye.

Cross-editor and cross-OS baseline

.editorconfig sets indent, charset, final newline, and trailing whitespace, and most editors honour it with no plugin. .gitattributes with * text=auto eol=lf stops line endings from flipping between Windows and macOS. This layer needs no per-language tool and comes first.

Import order

One deterministic order, grouped and sorted, so imports stop churning in diffs.

LanguageTool
JS, TSeslint-plugin-import (import/order), or simple-import-sort
Pythonruff, rule group I (replaces isort)
Gogoimports, keeps the standard library in its own group
Rustrustfmt (group_imports, imports_granularity)
Javagoogle-java-format, or checkstyle ImportOrder
Kotlinktlint
C, C++clang-format (SortIncludes, IncludeCategories)
Shellno import system, nothing to order

Imports from the root, not deep relative

A deep ../../../ path breaks the moment a file moves. Prefer a root alias or an absolute module path.

LanguageHow to enforce
JS, TStsconfig paths (@/), plus eslint no-relative-parent-imports
Pythonruff TID252, ban-relative-imports
Gothe module path is absolute by design
Rustprefer crate:: paths over deep super::, held in review
Javapackage imports are absolute by design
Kotlinpackage imports are absolute by design
C, C++include paths via -I, not deep relative ../, held in review
Shellno import system, not applicable

Naming

Casing follows the language idiom and is enforced by lint, not by review. Do not invent a house casing the language does not already use.

LanguageTool
JS, TS@typescript-eslint/naming-convention
Pythonruff, rule group N (pep8-naming)
Gorevive, or the compiler for exported names
Rustthe compiler's non-snake-case and non-camel-case lints, plus clippy
Javacheckstyle
Kotlinktlint, or detekt
C, C++clang-tidy readability-identifier-naming
Shellshellcheck flags some, casing mostly by convention

Unused imports and dead code

Turn on autofix so unused imports and variables clear on save or commit, not in review.

LanguageTool
JS, TSeslint no-unused-vars, unused-imports
Pythonruff F401 for imports, F841 for variables
Gogoimports drops unused imports, the compiler rejects unused variables
Rustthe compiler's unused_imports and dead_code lints
Javacheckstyle UnusedImports, the IDE for unused locals
Kotlindetekt, or the compiler's unused warnings
C, C++compiler -Wunused, clang-tidy
Shellshellcheck SC2034 for unused variables

File and folder names

One casing scheme for file and folder names, matching the language idiom, enforced by lint where a rule exists.

LanguageTool or convention
JS, TSeslint unicorn/filename-case, one of kebab or camel
Pythonsnake_case by pep8, no strong linter, hold it in review
Golowercase package folders, no underscores, the go convention
Rustfiles snake_case, the module follows the file, by convention
Javathe file name must match the public class, enforced by the compiler
Kotlinmatches the class for a single-class file, by convention
C, C++one scheme, by convention, held in review
Shellone scheme, by convention, held in review

Layer folder names and where a file sits by role are an architecture concern. See architecture-review, not this section.


4. When no tooling exists, set it up

Adding formatters, linters, a hook and a CI job changes the repository and its dependencies. Propose the exact list and get the user's agreement before adding it. Then set up three layers, because only all three make every human consistent:

  1. Config for the formatter and linter, one per language present. Prefer the tool's defaults over a long custom config. Fewer rules drift less.
  2. A pre-commit hook so a badly formatted change cannot be committed. Use the pre-commit framework, which manages hooks for any language from one .pre-commit-config.yaml, rather than a JS-only manager.
  3. A CI job that runs the same tools in check mode, so a commit made with --no-verify or through the web UI is still caught.

The hook and CI must run the same tools with the same config, so local and CI cannot disagree.

Caveat for machines with a global git config core.hooksPath set: it bypasses a repo's .git/hooks. The pre-commit framework can install into the active hooks path. Check git config core.hooksPath first and install accordingly.


5. Do not reformat the world

A formatting change that touches files the feature never touched buries the real diff and rewrites blame for everyone.

  • Format only the lines or files the change actually touches. Most formatters and the pre-commit framework support staged-files-only runs.
  • A repo-wide first-time format is a separate commit of its own, style: type, with no logic change, so it can be reviewed and skipped in blame (.git-blame-ignore-revs).
  • Never mix a reformat with a feature in one commit.

6. Architecture consistency is a different skill

Keeping new features designed the same way is not a formatting job. Use architecture-review to check a change against the repository's layering, and codebase-design to design a new module. This skill stops at style and lint.


Reference conventions

  • Each language's official formatter and its default rules
  • .editorconfig for cross-editor basics
  • pre-commit for language-agnostic hook management
  • The repository's own config, which wins over every default above

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.