From golang
Runs golangci-lint and systematically fixes all reported issues in the codebase, creating a todo list and re-running until all checks pass.
How this command is triggered — by the user, by Claude, or both
Slash command
/golang:lint-fixThe summary Claude sees in its command listing — used to decide when to auto-load this command
## Name golang:lint-fix ## Synopsis ## Description This command runs golangci-lint and systematically fixes all reported issues in the codebase. It creates a todo list to track progress and fixes issues by category until all linter checks pass. This command handles common linter categories including goconst, gocyclo, prealloc, revive, staticcheck, and unparam with appropriate fix strategies for each. ## Implementation Follow this process: 1. **Run the "Go Lint" skill** to identify all issues, extract the `golangci-lint` exact call from the skill and remember it. Pass through an...
golang:lint-fix
/golang:lint-fix
/golang:lint-fix [<linter-flags>]
This command runs golangci-lint and systematically fixes all reported issues in the codebase. It creates a todo list to track progress and fixes issues by category until all linter checks pass.
This command handles common linter categories including goconst, gocyclo, prealloc, revive, staticcheck, and unparam with appropriate fix strategies for each.
Follow this process:
Run the "Go Lint" skill to identify all issues,
extract the golangci-lint exact call from the skill and remember it.
Pass through any additional flags the user provided.
With the exact golangci-lint command, run with --fix appended,
to automatically fix any auto-fixable issues.
hack/go-lint.sh (a containerized script), the --fix flag cannot be passed to it. In this case, run golangci-lint run --fix directly (using the same config file if one exists in the repo, e.g., --config=.golangci.yaml).For the rest of the issues, create a todo list to track fixing each category of issues
Fix all issues systematically using these example strategies:
//nolint:gocyclo comments for complex test functions with justificationmake([]T, 0, capacity)//)Re-run exact golangci-lint command again after each category to verify fixes
Continue until all issues are resolved
//nolint:gocyclo with reason "Table-driven test with inherent complexity"//nolint comments rather than modifying the code//nolint:staticcheck,revive with reason "Ginkgo/Gomega DSL convention"//nolint:unparam if they're needed for interface compatibilityRun the "Go Lint" skill one last time to confirm all issues are resolved (0 issues).
Basic usage:
/golang:lint-fix
Output:
Running make lint... Found 23 issues
Creating todo list:
☐ Fix goconst issues (8)
☐ Fix staticcheck issues (7)
☐ Fix gocyclo issues (4)
☐ Fix revive issues (4)
Fixing goconst issues...
✓ Added constant APIContentType for "application/json"
✓ Added constant DefaultTimeout for "30s"
...
Running make lint... 15 issues remaining
...
✓ All linter issues resolved (0 issues)
Already clean codebase:
/golang:lint-fix
Output:
Running make lint... 0 issues found
✓ Code already passes all linter checks
golangci-lint invocation.npx claudepluginhub deepsm007/ai-helpers --plugin golang/lint-fixRuns golangci-lint and systematically fixes all reported issues in the codebase, creating a todo list and re-running until all checks pass.
/lint-fixAuto-fixes Go linting issues using golangci-lint, gofmt, goimports, and gofumpt. Supports --check, --staged, and --fix-unsafe flags.
/go-buildIncrementally fixes Go build errors, vet warnings, and linter issues by running diagnostics, parsing errors, and applying surgical fixes one at a time with verification after each change.
/go-buildFixes Go build errors, go vet warnings, and linter issues incrementally. Runs diagnostics, parses errors by severity, applies surgical fixes, and verifies each change.
/gen-linterGenerates .golangci.yml configuration for golangci-lint in Go projects with 90+ linters enabled by default. Supports --force to overwrite and --dry-run for preview.
/lint-fixAuto-fixes all linting and formatting issues in the project. Detects project type and runs appropriate formatters and linters with auto-fix enabled.