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

cfn-lint

$ cfn-lint Official Low Risk
Amazon Web Services · Cloud & Infra · MIT-0 · macos / linux / windows

cfn-lint validates AWS CloudFormation YAML and JSON templates offline against official AWS CloudFormation resource specifications and built-in rules. Its -f json output gives coding agents exact file, line, column, and rule IDs for automated template fixes.

FCRS-1.0 Score
94 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install cfn-lint
CLI vs MCP Decision CLI Preferred vs MCP

Runs locally in milliseconds with -f json; much faster and zero-token-overhead compared to calling an AWS MCP server.

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

Supports -f json (--format json) and SARIF, exits cleanly with bitmask severity codes, and never prompts interactively.

  • Native -f json / --format json diagnostic array
  • Bitmask exit codes distinguishing errors, warnings, and informational findings
Trust & Safety 25 / 25

Strictly read-only static analyzer requiring zero AWS credentials or network access during normal linting.

  • 100% read-only local execution with zero IAM credentials
Setup & Portability 13 / 15

Available via Homebrew, pip, and uvx across macOS, Linux, and Windows; requires Python runtime when installed via pip.

  • Cross-platform Python package with Homebrew and uvx support
Utility & Efficiency 14 / 15

Catches AWS schema, intrinsic function, and region errors locally before slow cloudformation deploy cycles.

  • Bundled AWS CloudFormation specs eliminate API round-trips
Maintenance & Lineage 10 / 10

Official AWS CloudFormation team repository (aws-cloudformation/cfn-lint) under MIT-0 with frequent spec updates.

  • Official AWS-maintained repo with MIT-0 license
Docs & Verifiability 9 / 10

Extensive rule documentation, schema coverage, and clear --help flags.

  • Comprehensive rule index and CLI flags in repo docs

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

No AWS credentials required; uses bundled AWS CloudFormation resource schemas locally.

Side Effects
Read-Only
Cost & Quotas

MIT-0 open-source by AWS; completely free and offline.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# cfn-lint Agent Rules
- Always pass `-f json` when validating CloudFormation templates for automated parsing.
- Use `-r <region>` when templates target regions other than `us-east-1`.
- Treat exit code `2` (errors) as blocking; inspect warnings (`4`) per `.cfnlintrc`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Lint CloudFormation template as JSON
cfn-lint template.yaml -f json

Validates the template offline and returns structured JSON diagnostics with line numbers and rule IDs.

Validate templates across specific AWS regions
cfn-lint 'templates/**/*.yaml' -r us-east-1 us-west-2 -f json

Checks resource availability and property specs against the specified AWS regions.

Strengths for Agents

  • + Structured -f json output pinpoints file, line, column, rule ID, and remediation message.
  • + Zero AWS credentials needed; validates templates offline against AWS schemas.
  • + Bitmask exit codes let agents distinguish hard errors from warnings.

Caveats & Pitfalls

  • ! Python runtime dependency slightly slows cold start compared to static Go binaries.
  • ! Custom CloudFormation macros/transforms may require --ignore-checks tuning.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI