Staticcheck
$ staticcheck Community Low RiskDeep SSA-based Go static analyzer detecting subtle bugs, deprecated APIs, style simplifications, and dead code. Purely read-only with newline-delimited JSON diagnostics (-f json), rule explanations (-explain), and precise check filtering (-checks).
brew install staticcheck Local Go SSA analyzer with -f json; direct CLI execution is the canonical workflow.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Clean -f json (NDJSON) output, -checks selection, -explain <CODE> self-documentation, and zero interactive prompts.
-f jsonemits machine-readable NDJSON diagnostics-explain <CODE>provides self-contained rule explanations
Strictly read-only static analyzer; never writes files or makes network calls.
- Zero write side effects
Available via Homebrew, go install, and GitHub Releases across macOS, Linux, and Windows; requires Go SDK.
- Static Go binary with Go SDK requirement for type-checking
High signal-to-noise ratio compared to noisier linters; catches real bugs, unused code, and deprecations.
- Low false-positive rate across SA/S/ST/QF check families
Well-established MIT-licensed project (dominikh/go-tools), also embedded inside golangci-lint.
- Respected
dominikh/go-toolscodebase under MIT
Clear check reference at staticcheck.dev/docs/ and built-in -explain flag.
- Official docs at staticcheck.dev/docs/
Security, Auth & Guardrails
Purely local Go static analysis; no credentials stored or required.
MIT open-source Go binary; completely free.
# Staticcheck Agent Rules - Run `staticcheck -f json ./...` for structured Go bug and deprecation checks. - Use `staticcheck -explain <CODE>` whenever you need authoritative context on a diagnostic.
Agent-Ready Command Recipes
Safe Read-Only Queries
staticcheck -f json ./...
Outputs one JSON object per diagnostic with code, severity, location, and message.
staticcheck -explain SA1019
Prints detailed documentation and remediation guidance for rule SA1019.
Strengths for Agents
- +
-f jsonemits crisp NDJSON diagnostics and-explain <CODE>lets agents self-serve rule docs. - + Strictly read-only with very low false-positive rates.
Caveats & Pitfalls
- !
-f jsonoutputs newline-delimited JSON objects (one per finding) rather than a single JSON array. - ! Requires the Go toolchain installed to load and type-check target packages.