Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

ktlint

$ ktlint Community Low Risk
Pinterest / ktlint · Code & DevOps · MIT · macos / linux / windows

Zero-configuration Kotlin linter and formatter enforcing official Kotlin coding conventions and .editorconfig settings. Supports --reporter=json (plus SARIF/Checkstyle) for structured agent parsing and -F (--format) for auto-formatting.

FCRS-1.0 Score
79 /100
Good
Medium Confidence
Zero-Friction Install
brew install ktlint
CLI vs MCP Decision CLI Only

Lints and formats local Kotlin .kt/.kts files offline; no MCP server adds value.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Supports --reporter=json, --reporter=sarif, --relative, and --log-level=error, though lacks a --dry-run diff preview.

  • --reporter=json outputs structured JSON findings
Trust & Safety 22 / 25

Read-only by default; mutates files only when -F / --format is passed.

  • Non-destructive default lint run; explicit -F opt-in
Setup & Portability 11 / 15

Easy via Homebrew or release JAR/script, but requires a JVM runtime and incurs JVM startup latency.

  • JVM dependency and cold startup overhead
Utility & Efficiency 11 / 15

Standard Kotlin style linter/formatter, though slower than native binaries and often wrapped in Gradle.

  • Enforces official Kotlin style guide + .editorconfig
Maintenance & Lineage 8 / 10

Established community standard (pinterest/ktlint) under MIT license.

  • Maintained at pinterest/ktlint
Docs & Verifiability 7 / 10

Clear CLI installation, .editorconfig, and rule reference at ktlint.github.io.

  • Official docs at ktlint.github.io

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Offline local Kotlin linter/formatter; no credentials stored or required.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source Kotlin/JVM CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# ktlint Agent Rules
- Always run `ktlint --reporter=json` read-only before running `ktlint -F`.
- Quote glob arguments (e.g. `"src/**/*.kt"`) so ktlint performs recursive matching across platforms.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint Kotlin sources with JSON reporter
ktlint --reporter=json "src/**/*.kt"

Emits JSON violation arrays per file with line, column, message, and rule ID without modifying files.

Controlled Writes & Previews

Format Kotlin files in place
ktlint -F "src/**/*.kt"

Auto-formats fixable Kotlin style violations in place.

Strengths for Agents

  • + Zero-config defaults plus native --reporter=json and --reporter=sarif.
  • + Respects .editorconfig and enforces standard Kotlin conventions consistently.

Caveats & Pitfalls

  • ! Requires Java/JVM runtime with noticeable startup latency on small single-file runs.
  • ! Unquoted **/*.kt globs can expand unexpectedly in shells instead of using ktlint's internal globbing.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI