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

StyLua

$ stylua Community Low Risk
JohnnyMorganz · Code & DevOps · MPL-2.0 · macos / linux / windows

Fast Rust-based formatter for Lua 5.1–5.4, LuaJIT, and Roblox Luau codebases. Supports --check dry-run verification, --output-format json / unified diff reporting, and --verify AST safety checks.

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

Formats Lua and Luau repositories locally in milliseconds; no MCP server needed.

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 21 / 25

Supports --check, --output-format json / unified, --color Never, and --respect-ignores.

  • --check --output-format json returns structured mismatch records
  • --color Never disables ANSI color escapes
Trust & Safety 23 / 25

Offers --check read-only verification and --verify to abort if formatting alters the parsed AST.

  • --verify validates AST equivalence before finalizing edits
Setup & Portability 15 / 15

Single static Rust binary distributed via Homebrew, Cargo, npm wrapper, and GitHub Releases.

  • Zero runtime dependencies on macOS, Linux, and Windows
Utility & Efficiency 12 / 15

De-facto standard formatter for Neovim plugins and Roblox Luau projects with fast Rust execution.

  • Supports Lua 5.1–5.4, LuaJIT, and Luau syntax
Maintenance & Lineage 8 / 10

Actively maintained community standard (JohnnyMorganz/StyLua) under MPL-2.0.

  • Popular JohnnyMorganz/StyLua repository
Docs & Verifiability 8 / 10

Well-structured README documenting stylua.toml options and CLI flags.

  • Official README and --help output

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Purely local formatter; no credentials stored or required.

Side Effects
Read-Only Local Write
Cost & Quotas

MPL-2.0 open-source Rust binary; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# StyLua (stylua) Agent Rules
- Run `stylua --check --color Never .` before formatting to inspect pending diffs.
- Pass `--verify` when formatting critical Lua/Neovim configs to guarantee AST equivalence.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check Lua formatting with JSON mismatch output
stylua --check --output-format json --color Never .

Reports unformatted files and diffs in JSON and exits non-zero without editing any files.

Controlled Writes & Previews

Format Lua files with AST verification
stylua --verify lua/

Reformats lua/ in place and verifies the output AST matches the original before writing.

Strengths for Agents

  • + --verify guarantees AST equivalence so formatting never silently changes Lua semantics.
  • + Fast single Rust binary with --check --output-format json and --color Never.

Caveats & Pitfalls

  • ! Note that running stylua . without --check writes files in place immediately.
  • ! Scoped strictly to Lua/Luau formatting; does not lint logic errors (pair with selene or luacheck).

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI