Run linters/formatters on changed files and apply safe, mechanical fixes. Use in Flow 3 and Flow 4.
You are a helper for running formatters and linters in this repository. Your job is to apply safe, mechanical fixes that improve code hygiene without changing behavior.
The auto-linter skill provides automated code formatting and linting across the codebase. It:
The goal is polish, not behavior change. Formatting is deterministic and safe. Lint fixes vary by confidence level.
| Flow | Purpose |
|---|---|
| Flow 3 (Build) | Called by standards-enforcer after implementation to polish the diff |
| Flow 4 (Review) | Called to verify code meets standards before merge decision |
| Ad-hoc | When code hygiene sweep is needed before commit |
Typical invocation chain:
code-implementer (writes code)
-> test-executor (verifies behavior)
-> standards-enforcer (calls auto-linter)
-> repo-operator (commits polished code)
| Tool | Purpose | Auto-fix |
|---|---|---|
cargo fmt |
Code formatting | Yes - always safe |
cargo clippy |
Linting + static analysis | Report only (some --fix allowed) |
Commands:
# Format (modifies files)
cargo fmt --all
# Format check only (no changes)
cargo fmt --all -- --check
# Lint (report findings)
cargo clippy --all-targets --all-features -- -D warnings
# Lint with auto-fix (machine-applicable only)
cargo clippy --all-targets --all-features --fix --allow-dirty --allow-staged -- -D warnings
| Tool | Purpose | Auto-fix |
|---|---|---|
prettier |
Code formatting | Yes - always safe |
eslint |
Linting | Yes for --fix, some manual |
biome |
Format + lint | Yes for format, lint varies |
Commands:
# Prettier format
npx prettier --write "src/**/*.{js,ts,jsx,tsx}"
# Prettier check
npx prettier --check "src/**/*.{js,ts,jsx,tsx}"
# ESLint with auto-fix
npx eslint --fix "src/**/*.{js,ts,jsx,tsx}"
# ESLint report only
npx eslint "src/**/*.{js,ts,jsx,tsx}"
# Biome (combined)
npx biome check --apply src/
| Tool | Purpose | Auto-fix |
|---|---|---|
black |
Code formatting | Yes - always safe |
ruff |
Fast linting + formatting | Yes for many rules |
isort |
Import sorting | Yes - always safe |
mypy |
Type checking | Report only |
Commands:
# Black format
black src/ tests/
# Black check
black --check src/ tests/
# Ruff lint with auto-fix
ruff check --fix src/ tests/
# Ruff format
ruff format src/ tests/
# isort
isort src/ tests/
# mypy (no auto-fix)
mypy src/
| Tool | Purpose | Auto-fix |
|---|---|---|
gofmt / goimports |
Code formatting | Yes - always safe |
golangci-lint |
Meta-linter | Some rules fixable |
staticcheck |
Static analysis | Report only |
Commands:
# Format
gofmt -w .
goimports -w .
# golangci-lint
golangci-lint run --fix ./...
# golangci-lint report only
golangci-lint run ./...
| Language | Format Tool | Lint Tool |
|---|---|---|
| Java | google-java-format |
checkstyle, spotbugs |
| C/C++ | clang-format |
clang-tidy |
| Ruby | rubocop --autocorrect |
rubocop |
| Shell | shfmt |
shellcheck |
These changes are mechanical and do not alter behavior:
These may change behavior or require judgment:
If the tool marks the fix as "machine-applicable" or "safe", apply it. If marked as "suggestion" or "manual", report it for human review.
Prefer scoped runs on changed files:
# Get changed Rust files
git diff --name-only origin/main...HEAD | grep '\.rs$'
# Get changed JS/TS files
git diff --name-only origin/main...HEAD | grep -E '\.(js|ts|jsx|tsx)$'
If no changed-files info is available, run on the entire project.
Format first, as it may resolve some lint issues:
# Rust
cargo fmt --all
# JS/TS
npx prettier --write "src/**/*.{js,ts,jsx,tsx}"
# Python
black src/ tests/ && isort src/ tests/
After formatting, run linters:
# Rust
cargo clippy --all-targets --all-features -- -D warnings 2>&1 | tee lint_output.log
# JS/TS
npx eslint "src/**/*.{js,ts,jsx,tsx}" 2>&1 | tee lint_output.log
# Python
ruff check src/ tests/ 2>&1 | tee lint_output.log
Save all output to artifacts:
lint_output.log - Raw tool output (overwrite per run)lint_summary.md - Parsed summary with counts and categoriesReport back with:
Check for configuration files to determine which tools to use:
| File | Stack | Tools |
|---|---|---|
Cargo.toml |
Rust | cargo fmt, clippy |
package.json |
JS/TS | prettier, eslint, biome |
pyproject.toml |
Python | black, ruff, mypy |
go.mod |
Go | gofmt, golangci-lint |
.tool-versions |
Multiple | Use specified versions |
Respect project configuration:
.prettierrc, .prettierignore.eslintrc.*, .eslintignorepyproject.toml (black, ruff sections)rustfmt.toml, clippy.toml.golangci.ymlIf a project defines custom lint commands (in package.json scripts, Makefile, etc.), prefer those:
# If defined in package.json
npm run lint
npm run format
# If defined in Makefile
make lint
make fmt
# Step 1: Format
cargo fmt --all
# Step 2: Lint
cargo clippy --all-targets --all-features -- -D warnings 2>&1 | tee lint_output.log
# Step 3: Report
# Files formatted: src/lib.rs, src/main.rs
# Clippy: 0 errors, 2 warnings
# Step 1: Format
npx prettier --write "src/**/*.{js,ts,jsx,tsx}"
# Step 2: Lint with auto-fix
npx eslint --fix "src/**/*.{js,ts,jsx,tsx}" 2>&1 | tee lint_output.log
# Step 3: Report
# Files formatted: 12 files
# ESLint: 0 errors, 5 warnings (3 auto-fixed)
# Step 1: Format
black src/ tests/
isort src/ tests/
# Step 2: Lint
ruff check src/ tests/ 2>&1 | tee lint_output.log
# Step 3: Type check (optional)
mypy src/ 2>&1 | tee -a lint_output.log
# Step 4: Report
# Files formatted: 8 files
# Ruff: 0 errors, 3 warnings
# Mypy: 0 errors
Raw output from all tools run. Include command and exit code:
=== cargo fmt ===
(no output - all files formatted)
Exit code: 0
=== cargo clippy ===
warning: unused variable: `x`
--> src/lib.rs:42:9
|
42 | let x = 5;
| ^ help: if this is intentional, prefix it with an underscore: `_x`
|
= note: `#[warn(unused_variables)]` on by default
Exit code: 0
# Lint Summary
## Tools Run
- cargo fmt: PASS (0 files modified)
- cargo clippy: PASS (0 errors, 2 warnings)
## Warnings
| File | Line | Code | Message |
| ---------- | ---- | ----------------------- | --------------------------- |
| src/lib.rs | 42 | unused_variables | unused variable: `x` |
| src/lib.rs | 87 | clippy::needless_return | unneeded `return` statement |
## Files Modified by Formatting
- (none)
## Manual Fixes Required
- (none)
error: cargo fmt not found
Solution: Ensure the tool is installed and in PATH. For Rust: rustup component add rustfmt clippy
error: conflicting configuration in .prettierrc and .editorconfig
Solution: Remove conflicting settings or ensure consistency across config files.
error: EACCES: permission denied, open 'src/file.ts'
Solution: Check file permissions. May indicate file is locked by another process.
This is expected when there are errors. Check lint_output.log for details:
This is normal behavior. After formatting:
git diffThe standards-enforcer agent calls this skill as part of its hygiene sweep:
When called by standards-enforcer:
The diff should look like it came from a professional engineer. Consistent formatting, no obvious style violations, clean imports. Auto-linting is the mechanical polish that lets reviewers focus on logic and design, not whitespace and semicolons.
Machine time is cheap. Human attention is expensive. Let the tools handle the mechanical parts.