go-lint-and-vet
Skill0 starsChanged 2 months agoMITView on GitHub
Guides agents through running and resolving go vet and golangci-lint diagnostics without ignoring errors.
In this repository49 other files it gives its agents.
- bug-reproducerSkill
- claim-checkerSkill
- command-failure-diagnoserSkill
- config-risk-reviewerSkill
- csv-validatorSkill
- deployment-checklist-makerSkill
- diff-reviewerSkill
- factual-summarizerSkill
- field-extractorSkill
- api-contract-testerSkill
- database-migration-helperSkill
- security-vulnerability-fixerSkill
- git-commit-stagerSkill
- git-conflict-resolverSkill
- github-actions-debuggerSkill
- github-issue-triagerSkill
- github-pr-creatorSkill
- github-pr-reviewerSkill
- go-code-qualitySkill
- go-testingSkill
- json-schema-converterSkill
- lint-and-typecheckSkill
- meaning-preserving-editorSkill
- meeting-notes-to-actionsSkill
- minimal-bug-fixSkill
- option-comparatorSkill
- py-code-qualitySkill
- py-lint-and-typecheckSkill
- py-testingSkill
- readme-writerSkill
- regression-test-writerSkill
- release-notes-drafterSkill
- repo-inspectorSkill
- research-briefSkill
- reversible-cleanup-plannerSkill
- rust-clippy-checkSkill
- rust-code-qualitySkill
- rust-testingSkill
- small-refactorSkill
- status-updateSkill
- step-by-step-tutorialSkill
- step-decomposerSkill
- tabular-analyzerSkill
- task-briefSkill
- test-runner-debuggerSkill
- ts-code-qualitySkill
- ts-lint-and-typecheckSkill
- ts-testingSkill
- skill-templateSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Use this skill when:
- Very specific: line 20
Do not use for testing; use go-testing.
- Very specific: line 26
If package_path is missing: default to ./....
- Very specific: line 27
Absolute Ban: Never resolve errcheck by writing _ = fn().
- Distinctive: line 30
Follow these numbered actions:
- Very specific: line 43
If errcheck flags an unhandled close call: check if err := f.Close().
- Distinctive: line 69
Stop and ask the user when:
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Go Lint and Vet (golangci-lint & go vet)
Runs standard Go static analysis tools (go vet, golangci-lint). Enforces error checking (errcheck), struct alignment (govet), and clean conventions.
1. Purpose
Catch unhandled errors, unreachable code, and concurrency bugs in Go code before runtime.
2. When to Use
Use this skill when:
- Verifying Go code before PR submission.
- Fixing
errcheckviolations where returned errors were ignored. - Running
golangci-lint run ./....
3. When Not to Use
- Do not use for testing; use
go-testing.
4. Required Inputs
package_path: Go package path to check (default:./...).
5. Missing-Input Behavior
- If
package_pathis missing: default to./.... - Absolute Ban: Never resolve
errcheckby writing_ = fn(). Always handle the error.
6. Procedure
Follow these numbered actions:
- Action 1: Run go vet
- Execute:
go vet <package_path>
- Execute:
- Action 2: Run golangci-lint
- Execute:
golangci-lint run <package_path>
- Execute:
- Action 3: Fix Error Checks
- Add explicit
if err != nil { return err }.
- Add explicit
- Action 4: Format Code
- Execute:
gofmt -w <target_file>
- Execute:
- Action 5: Re-verify
- Confirm exit code 0.
7. Decision Rules
- If
errcheckflags an unhandled close call: checkif err := f.Close(); err != nil.
8. Output Format
Emit the report using this template:
### Go Lint & Vet Report: [Package]
- **go vet**: PASS
- **golangci-lint**: PASS
- **Issues Resolved**: [Count]
#### Resolved Issues
- `[file:line]`: [Description of fix]9. Verification Checklist
go vetexits code 0.golangci-lintexits code 0.- No
_ = errblank assignments introduced.
10. Common Failures and Recovery
| Failure Symptom | Cause | Recovery Action |
errcheck: error return value not checked | Calling method returning error | Check if err != nil. |
11. Stop or Escalation Conditions
Stop and ask the user when:
- Lint rule conflicts with third-party generated protobuf code.
12. Examples
Example 1: Successful Execution
Input:
Package: ./internal/server
Error: errcheck: Error return value of `res.Body.Close` is not checkedOutput:
### Go Lint & Vet Report: ./internal/server
- **go vet**: PASS
- **golangci-lint**: PASS
- **Issues Resolved**: 1
#### Resolved Issues
- `server.go:42`: Added `defer func() { _ = res.Body.Close() }()` or error logging check.Example 2: Ambiguous or Missing Input
Input:
Lint go.Output:
### Go Lint & Vet Report: Defaulting to ./...
- **go vet**: PASS
- **golangci-lint**: PASS
- **Issues Resolved**: 0Example 3: Expected Final Output
Output:
### Go Lint & Vet Report: ./cmd/cli
- **go vet**: PASS
- **golangci-lint**: PASS
- **Issues Resolved**: 2Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

