/go-specialist:gen-goreleaser [--force] [--minimal] [--dry-run]from go-specialist
Generates complete GoReleaser configuration with multi-arch Docker builds, release automation, and package distribution for Go projects. Replaces manual setup with a single invocation.
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 complete GoReleaser setup for Go projects with multi-architecture Docker builds, automated releases, and package distribution. This skill replaces the multi-step manual setup with a single invocation.
Problem: Setting up GoReleaser requires:
Solution: One-command generation that:
.goreleaser.yml (316 lines)Dockerfile for multi-arch buildsCRITICAL: When generating any content (configuration files, Dockerfiles, 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 GoReleaser files:
test -f .goreleaser.yml || test -f .goreleaser.yaml
test -f Dockerfile
test -d resources/etc
existingConfig = true/false (for .goreleaser.yml/yaml)existingDockerfile = true/falseexistingResources = true/falseexistingFile = <filename> if config existsCheck for GoReleaser binary (non-blocking):
command -v goreleaser
goreleaser --version and storegoreleaserNotInstalled = true (will show warning)Check for Docker with buildx (non-blocking):
command -v docker && docker buildx version
dockerNotInstalled = true (will show warning)Verify skill assets directory:
${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/.goreleaser.yml${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/Dockerfile${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/resources/etc/passwdParse skill arguments from $argument string:
Supported flags:
--force: Skip confirmation for existing files--minimal: Generate only .goreleaser.yml (no Dockerfile or resources)--dry-run: Show preview without writing filesParsing logic:
arguments = split($argument by space)
for each arg in arguments:
if arg == "--force": set forceMode = true
if arg == "--minimal": set minimalMode = true
if arg == "--dry-run": set dryRunMode = true
File Selection:
Standard mode (default): All 3 files
.goreleaser.yml (316 lines, ~10 KB)Dockerfile (64 lines, ~2 KB)resources/etc/passwd (3 lines, <1 KB)Minimal mode (--minimal): 1 file only
.goreleaser.yml (316 lines, ~10 KB)Read template files from skill assets directory:
Templates to read:
.goreleaser.yml (always read)
${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/.goreleaser.ymlDockerfile (skip if minimalMode = true)
${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/Dockerfileresources/etc/passwd (skip if minimalMode = true)
${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/resources/etc/passwdReading logic:
For each file:
Use Read tool to read: ${CLAUDE_PLUGIN_ROOT}/assets/goreleaser/<filename>
Store content as: goreleaser_template, dockerfile_template, passwd_template
Verify: content is not empty
Error handling:
Detection Function Library: Use the shared detection functions from ${CLAUDE_PLUGIN_ROOT}/assets/detection-functions.md. Read that file to get all bash detection functions (detect_project_name, detect_git_owner, detect_main_dir, detect_registry, detect_author, substitute_placeholders).
Detection Workflow:
Detect all values:
PROJECT_NAME=$(detect_project_name)
OWNER=$(detect_git_owner)
REGISTRY=$(detect_registry)
MAIN_DIR=$(detect_main_dir)
AUTHOR_INFO=$(detect_author)
AUTHOR_NAME=$(echo "$AUTHOR_INFO" | cut -d'|' -f1)
AUTHOR_EMAIL=$(echo "$AUTHOR_INFO" | cut -d'|' -f2)
Handle missing critical values (use AskUserQuestion if empty):
PROJECT_NAME is empty: Prompt user for project name or use "app"OWNER is empty: Prompt user for owner or preserve [OWNER] placeholderSubstitute placeholders in all templates:
goreleaser_template=$(substitute_placeholders "$goreleaser_template" \
"$PROJECT_NAME" "$OWNER" "$REGISTRY" "$MAIN_DIR" "$AUTHOR_NAME" "$AUTHOR_EMAIL")
dockerfile_template=$(substitute_placeholders "$dockerfile_template" \
"$PROJECT_NAME" "$OWNER" "$REGISTRY" "$MAIN_DIR" "$AUTHOR_NAME" "$AUTHOR_EMAIL")
passwd_template=$(substitute_placeholders "$passwd_template" \
"$PROJECT_NAME" "$OWNER" "$REGISTRY" "$MAIN_DIR" "$AUTHOR_NAME" "$AUTHOR_EMAIL")
Fallback Strategy:
[PLACEHOLDER] if user skips promptBuild preview message:
📦 GoReleaser Configuration Preview
Mode: <Standard|Minimal>
Files to be created:
<LIST FILES BASED ON MODE>
Standard mode (3 files):
.goreleaser.yml (316 lines, ~10 KB)
Dockerfile (64 lines, ~2 KB)
resources/etc/passwd (3 lines)
Minimal mode (1 file):
.goreleaser.yml (316 lines, ~10 KB)
✅ Auto-detected Configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Settings:
• Project name: <PROJECT_NAME> (from go.mod)
• Binary name: <PROJECT_NAME>
• Main directory: <MAIN_DIR>
Repository Settings:
• Owner: <OWNER> (from git remote)
• Registry: <REGISTRY> (<GitHub Container Registry|GitLab Container Registry>)
Author Information:
• Name: <AUTHOR_NAME> (from git config)
• Email: <AUTHOR_EMAIL>
Configuration features:
✓ Multi-OS builds (Linux, macOS, Windows)
✓ Multi-arch support (amd64, arm64, arm, 386)
✓ Docker multi-arch manifests (linux/amd64, linux/arm64, linux/arm/v7)
✓ Automated changelog generation
✓ Archive creation with checksums
✓ GitHub/GitLab release integration
✓ Homebrew formula generation (optional)
✓ SBOM and attestation support
Build matrix:
• linux: amd64, arm64, arm, 386
• darwin: amd64, arm64
• windows: amd64, arm64, 386
Docker features (standard mode only):
✓ Multi-stage build (smaller images)
✓ Non-root user (security)
✓ Minimal Alpine base
✓ Automatic platform detection
✓ Distroless option available
<CONDITIONAL WARNINGS>
Next steps after generation:
1. Review and customize .goreleaser.yml
2. Update PROJECT_NAME placeholder
3. Configure Docker registry (ghcr.io, registry.gitlab.com, or docker.io)
4. Test with: goreleaser build --snapshot --clean
5. Set up CI/CD tokens for releases
Conditional warnings:
If existingConfig = true:
⚠️ WARNING: Existing GoReleaser configuration detected
File: <existingFile>
This will OVERWRITE your existing configuration.
Consider backing up before proceeding.
If existingDockerfile = true and minimalMode = false:
⚠️ WARNING: Existing Dockerfile detected
This will OVERWRITE your existing Dockerfile.
If you have custom Docker configuration, use --minimal mode or backup first.
If existingResources = true and minimalMode = false:
⚠️ WARNING: Existing resources/etc/ directory detected
passwd file will be overwritten if it exists.
If goreleaserNotInstalled = true:
ℹ️ INFO: GoReleaser binary not found
Configuration will be created, but you'll need to install GoReleaser:
• macOS: brew install goreleaser
• Linux: See https://goreleaser.com/install/
After installation, verify with: goreleaser --version
If dockerNotInstalled = true and minimalMode = false:
ℹ️ INFO: Docker or buildx not found
Dockerfile will be created, but you'll need Docker with buildx for multi-arch builds.
Install: https://docs.docker.com/buildx/working-with-buildx/
If binaryName = "app" (detection failed):
⚠️ WARNING: Could not detect binary name from go.mod
Using placeholder "app" - you'll need to update this in .goreleaser.yml
If mainDir = "." and multiple main.go exist:
ℹ️ INFO: Multiple main.go files found
Using project root. Verify 'dir' field in .goreleaser.yml if needed.
Confirmation logic:
If dryRunMode = true:
[DRY RUN MODE - No files will be written]
Skip to Phase 7 (report preview only)
If forceMode = true:
[--force mode enabled, skipping confirmation]
Proceed to Phase 6
If any existing files and forceMode = false:
Use AskUserQuestion:
Question: "Overwrite existing GoReleaser files?"
Options:
- "Yes, overwrite all files" (proceed to Phase 6)
- "No, cancel operation" (exit with message "Operation cancelled by user")
If no existing files:
Use AskUserQuestion:
Question: "Create GoReleaser configuration <in standard/minimal mode>?"
Options:
- "Yes, create files" (proceed to Phase 6)
- "No, cancel operation" (exit with message "Operation cancelled by user")
Write files based on mode:
Always create:
Use Write tool:
file_path: ./.goreleaser.yml (absolute path to project root)
content: goreleaser_template (no modifications, copy as-is)
Create only in standard mode (minimalMode = false):
Dockerfile
Use Write tool:
file_path: ./Dockerfile (absolute path to project root)
content: dockerfile_template (no modifications, copy as-is)
resources/etc/passwd
Create directory first:
bash: mkdir -p resources/etc
Use Write tool:
file_path: ./resources/etc/passwd (absolute path)
content: passwd_template (no modifications, copy as-is)
Writing logic:
For each file:
If minimalMode = true and file not in minimal list:
Skip file
Else:
Create parent directories if needed
Use Write tool to create file
Verify write succeeded
Error handling:
Post-creation validation: confirm each written file exists and is non-zero
(.goreleaser.yml, plus Dockerfile and resources/etc/passwd in standard mode) and
report its line count.
If dryRunMode == true: report that nothing was written, list the files that would be
created with their line counts, show the detected binary name and main package, and note
that dropping --dry-run performs the creation.
Otherwise report to the user — cover these facts; no fixed layout required:
.goreleaser.yml; in standard mode also
Dockerfile and resources/etc/passwd).grep -r '\[.*\]' .goreleaser.yml to find them. If none remain, say so — the config is
usable as-is with no manual editing.goreleaser check; build without releasing via
goreleaser build --snapshot --clean; rehearse the full run with
goreleaser release --snapshot --clean --skip=publish; inspect ls -la dist/; set the CI
tokens (GITHUB_TOKEN and GITLAB_TOKEN are automatic on their platforms,
HOMEBREW_TAP_TOKEN only if publishing to a tap); then cut the first release with
git tag -a v0.1.0 -m "Initial release", git push origin v0.1.0 and
goreleaser release --clean./gen-github-dir for GitHub Actions (includes a release workflow),
/gen-gitlab-ci for GitLab CI (includes a release job).goreleaserNotInstalled, remind to install it
(brew install goreleaser on macOS, otherwise https://goreleaser.com/install/) and verify
with goreleaser --version — v2.0.0+ is required. If dockerNotInstalled and not
minimalMode, remind to install Docker (https://docs.docker.com/get-docker/) with buildx
enabled (https://docs.docker.com/buildx/working-with-buildx/), verified via
docker buildx version.${CLAUDE_PLUGIN_ROOT}/docs/goreleaser-reference.md for configuration
patterns · ${CLAUDE_PLUGIN_ROOT}/docs/goreleaser-troubleshooting.md ·
https://goreleaser.comOn 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-goreleaser:
/gen-linter - Recommended to ensure code quality before releasesAfter gen-goreleaser:
/gen-github-dir - Includes release workflow that uses GoReleaser/gen-gitlab-ci - Includes release job that uses GoReleaser/gen-taskfiles - Can add release tasks for local testingTypical workflow:
# 1. Set up linting
/gen-linter
# 2. Configure releases
/gen-goreleaser
# 3. Test release process
goreleaser release --snapshot --clean --skip=publish
# 4. Set up CI/CD
/gen-github-dir # or /gen-gitlab-ci
# 5. Create first release
git tag -a v0.1.0 -m "Initial release"
git push origin v0.1.0
Use when:
Creates:
.goreleaser.yml - Full configurationDockerfile - Multi-stage optimized buildresources/etc/passwd - Non-root user configBenefits:
--minimal)Use when:
Creates:
.goreleaser.yml onlyBenefits:
Configuration maintenance:
--snapshot before taggingRelease workflow:
Docker best practices:
CI/CD integration:
Security considerations:
Project requirements:
Docker limitations:
Platform support:
Configuration complexity:
If goreleaser check fails:
yamllint .goreleaser.ymlIf builds fail:
go build <mainDir>go mod tidygoreleaser build --snapshot --single-targetIf Docker build fails:
docker build -t test .docker buildx lsIf release fails:
git tag -lSkill documentation:
${CLAUDE_PLUGIN_ROOT}/docs/goreleaser-reference.md${CLAUDE_PLUGIN_ROOT}/docs/goreleaser-troubleshooting.mdOfficial resources:
Related skills:
/gen-github-dir - GitHub Actions with release workflow/gen-gitlab-ci - GitLab CI with release job/gen-linter - Code quality before releasesCommunity 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-linterGenerate .golangci.yml configuration for Go linting with 90+ lintersnpx claudepluginhub sgaunet/claude-plugins --plugin go-specialistOther plugins' skills for the same job