/go-specialist:gen-linter [--force] [--dry-run]from go-specialist
Generates a professional .golangci.yml configuration for Go projects with 90+ linters enabled and sensible defaults.
Ships in go-specialist. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Instantly create a professional .golangci.yml configuration for Go projects with comprehensive linting coverage. This skill replaces the multi-step manual setup with a single invocation.
Problem: Setting up golangci-lint requires manually creating YAML configuration, understanding 90+ linter options, and balancing strict quality checks with pragmatic development - a 15-30 minute process prone to over-configuration.
Solution: One-command generation that:
.golangci.yml (224 lines)CRITICAL: When generating any content (configuration files, commit messages, or any other output):
Critical checks before proceeding:
Validate Git repository:
git rev-parse --git-dir
Validate Go project:
test -f go.mod
Check existing configuration:
test -f .golangci.yml || test -f .golangci.yaml
existingConfig = true and existingFile = <filename>existingConfig = falseCheck for golangci-lint binary (non-blocking):
command -v golangci-lint
linterNotInstalled = true (will show warning later)golangci-lint --version and store for reportVerify skill assets directory:
${CLAUDE_PLUGIN_ROOT}/assets/linter/.golangci.yml existsParse skill arguments from $argument string:
Supported flags:
--force: Skip confirmation if .golangci.yml already exists--dry-run: Show preview without writing fileParsing logic:
arguments = split($argument by space)
for each arg in arguments:
if arg == "--force": set forceMode = true
if arg == "--dry-run": set dryRunMode = true
File Selection:
.golangci.yml (224 lines)Read template file from skill assets directory:
Template location:
${CLAUDE_PLUGIN_ROOT}/assets/linter/.golangci.ymlReading logic:
Use Read tool to read: ${CLAUDE_PLUGIN_ROOT}/assets/linter/.golangci.yml
Store content as: templateContent
Verify: content is not empty and starts with "# golangci-lint"
Error handling:
No variable substitution required - the template is copied as-is.
Build preview message:
📋 golangci-lint Configuration Preview
Files to be created:
.golangci.yml (224 lines, ~6.5 KB)
Configuration features:
• Enables all linters by default (90+)
• Disables overly strict linters (goerr113, wrapcheck, etc.)
• 5-minute timeout for large projects
• Fast mode with caching enabled
• Parallel execution across all CPUs
• Project-agnostic settings
Excluded linters (too opinionated):
• depguard, exhaustruct, gci, gochecknoglobals
• godox, goerr113, inamedparam, maintidx
• nonamedreturns, testpackage, wrapcheck, wsl
Integration ready:
✓ GitHub Actions (via gen-github-dir)
✓ GitLab CI (via gen-gitlab-ci)
✓ Task runner (via gen-taskfiles)
✓ Pre-commit hooks
✓ VS Code, GoLand, Vim/Neovim
<CONDITIONAL WARNINGS>
Conditional warnings:
If existingConfig = true:
⚠️ WARNING: Existing configuration detected
File: <existingFile>
This will OVERWRITE your existing linter configuration.
Consider backing up your current settings before proceeding.
If linterNotInstalled = true:
ℹ️ INFO: golangci-lint binary not found
Configuration will be created, but you'll need to install golangci-lint to use it:
• macOS: brew install golangci-lint
• Other: go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
After installation, verify with: golangci-lint --version
Confirmation logic:
If dryRunMode = true:
[DRY RUN MODE - No files will be written]
Skip to Phase 6 (report preview only)
If forceMode = true:
[--force mode enabled, skipping confirmation]
Proceed to Phase 5
If existingConfig = true and forceMode = false:
Use AskUserQuestion:
Question: "Overwrite existing .golangci.yml configuration?"
Options:
- "Yes, overwrite configuration" (proceed to Phase 5)
- "No, cancel operation" (exit with message "Operation cancelled by user")
If existingConfig = false:
Use AskUserQuestion:
Question: "Create .golangci.yml in project root?"
Options:
- "Yes, create configuration" (proceed to Phase 5)
- "No, cancel operation" (exit with message "Operation cancelled by user")
Write configuration file:
Use Write tool to create:
File: .golangci.yml (in project root, not in .github/)
Content: <templateContent from Phase 3>
Writing logic:
Use Write tool:
file_path: ./.golangci.yml (absolute path to project root)
content: templateContent (no modifications, copy as-is)
Error handling:
Post-creation validation: confirm .golangci.yml exists and is non-zero, and report its
line count.
If dryRunMode == true: report that nothing was written, name the file that would be
created with its line count, and note that dropping --dry-run performs the creation.
Otherwise report to the user — cover these facts; no fixed layout required:
.golangci.yml with its line count.golangci-lint run ./...; auto-fix what can be fixed with
golangci-lint run --fix ./...; see which linters are active via
golangci-lint run -v ./...; isolate one linter with
golangci-lint run --disable-all --enable=govet ./...; edit .golangci.yml to adjust
enabled linters, timeouts or exclusions./gen-github-dir for GitHub Actions (includes a linter workflow),
/gen-gitlab-ci for GitLab CI (includes a lint job), /gen-taskfiles for the lint tasks."go.lintTool": "golangci-lint"; GoLand — Settings → Tools → File Watchers → add
golangci-lint; Vim/Neovim — configure the ale plugin with golangci-lint.linterNotInstalled, remind to install it —
brew install golangci-lint on macOS, otherwise
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest — and verify with
golangci-lint --version.On failure: report which files were written, which failed and why, and that --force
retries. Partial success is a warning, total failure an error — for a total failure also
name the likely causes (permissions, disk space, filesystem restrictions).
This skill works seamlessly with other go-specialist skills:
Before gen-linter:
After gen-linter:
/gen-github-dir - Includes linter workflow using this configuration/gen-gitlab-ci - Includes lint job using this configuration/gen-taskfiles - Includes lint tasks for local developmentTypical workflow:
# 1. Generate linter config
/gen-linter
# 2. Fix initial issues
golangci-lint run --fix ./...
# 3. Set up CI/CD
/gen-github-dir # or /gen-gitlab-ci
# 4. Add task automation
/gen-taskfiles
Configuration maintenance:
.golangci.yml when upgrading golangci-lint versions--fast flag firstCI/CD integration:
--timeout=5m for large projectsLocal development:
golangci-lint run ./...golangci-lint run --fix ./...Team adoption:
Golangci-lint installation:
Configuration style:
Performance considerations:
--fast flag for quick checks during developmentCI/CD requirements:
If linter fails after generation:
golangci-lint --versiongolangci-lint run --helpgolangci-lint run --disable-all --enable=govet ./...yamllint .golangci.ymlIf too many issues reported:
golangci-lint run --fix ./...--exclude patterns for known issuesIf conflicts with existing tooling:
.golangci.yml disable listOfficial documentation:
Related skills:
/gen-github-dir - GitHub Actions with linter workflow/gen-gitlab-ci - GitLab CI with lint jobs/gen-taskfiles - Task automation with lint tasksCommunity resources:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
11 skills in this plugin
/gen-forgejo-dirGenerate complete .forgejo/workflows directory with Forgejo Actions workflows (test, lint, release) for Go projects/gen-github-dirGenerate complete .github directory with workflows, dependabot, and funding configs for Go projects/gen-gitlab-ciGenerate GitLab CI/CD pipeline configuration for Go projects with testing, coverage, and automated releases/gen-goreleaserGenerate GoReleaser configuration with multi-arch Docker builds and release automationnpx claudepluginhub sgaunet/claude-plugins --plugin go-specialistOther plugins' skills for the same job