/go-specialist:gen-gitlab-ci [--force] [--dry-run]from go-specialist
Generates a mise-based .gitlab-ci.yml for Go projects with unit tests, linting, optional coverage, snapshot builds, and automated releases. Validates prerequisites and preserves customization comments.
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 .gitlab-ci.yml file for Go projects with a production-ready, mise-based GitLab CI/CD pipeline including unit tests, linting, optional coverage reporting, snapshot builds, and automated releases.
Problem: Setting up GitLab CI/CD for Go projects requires manually creating pipeline configuration, understanding GitLab CI syntax, and keeping tool versions in sync between local development and CI - a 30-45 minute process.
Solution: One-command generation that:
.gitlab-ci.yml configuration (mise-based)jdx/mise:latest image, installs tools via mise install, then runs task … — so CI uses the exact versions pinned in mise.tomlmise.toml exists at the repo root (creates one with detected versions if missing) — the single source of truth shared with local devCRITICAL: When generating any content (pipeline 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 .gitlab-ci.yml:
test -f .gitlab-ci.yml
existingGitlabCi = trueexistingGitlabCi = falseVerify skill assets directory:
${CLAUDE_PLUGIN_ROOT}/assets/gitlab-ci/.gitlab-ci.yml exists${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.toml existsCheck for .goreleaser.yml (non-blocking):
test -f .goreleaser.yml
goreleaserMissing = true (warn in Phase 6, don't block creation)goreleaserMissing = falseCheck existing mise.toml:
test -f mise.toml
existingMise = true|false. The pipeline depends on mise.toml; if it
is missing this skill creates one (Phase 3.5). An existing one is preserved.Parse skill arguments from $argument string:
Supported flags:
--force: Skip confirmation for existing .gitlab-ci.yml--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
No minimal mode: The template is already compact with comprehensive coverage.
Read template file from skill assets directory:
Files to read:
.gitlab-ci.yml
${CLAUDE_PLUGIN_ROOT}/assets/gitlab-ci/.gitlab-ci.yml.gitlab-ci.yml (project root)mise.toml [Only if existingMise == false]
${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.tomlmise.toml (repo root)Template handling:
.gitlab-ci.yml template is static apart from the runner tags: —
tool versioning lives in mise.toml.# CUSTOMIZE: commentsError handling:
Detection Function Library: Use the shared detection functions from ${CLAUDE_PLUGIN_ROOT}/assets/detection-functions.md. Read that file to get the bash detection functions (detect_go_version, detect_golangci_lint_version, detect_goreleaser_version, strip_leading_v, substitute_version_placeholders).
Detection Workflow:
The .gitlab-ci.yml template needs no version substitution. Every job runs
in the jdx/mise:latest image and installs tools via mise install, so tool
versions come from mise.toml, not the pipeline YAML. The only thing to review
is the runner tags: (see customizations).
Ensure mise.toml exists (create if missing):
if [[ "$existingMise" != "true" ]]; then
GO_VERSION=$(detect_go_version)
GOLANGCI_LINT_VERSION=$(detect_golangci_lint_version)
GORELEASER_VERSION=$(detect_goreleaser_version)
GOLANGCI_LINT_VERSION_BARE=$(strip_leading_v "${GOLANGCI_LINT_VERSION:-v2.2.2}")
mise_template=$(substitute_version_placeholders "$mise_template" \
"GO_VERSION=${GO_VERSION:-1.25}" \
"GOLANGCI_LINT_VERSION_BARE=${GOLANGCI_LINT_VERSION_BARE:-2.2.2}" \
"GORELEASER_VERSION=${GORELEASER_VERSION:-v2.12.0}")
# Written in Phase 5.
fi
existingMise == true: do NOT modify the existing mise.toml; note it in the report.Build preview summary:
File to be created:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ .gitlab-ci.yml
Pipeline Structure (mise-based):
- 2 Stages: test, release
- Jobs (each runs in jdx/mise:latest, `mise install`, then `task ...`):
• unit-tests: `task test` on every push
• linter: `task lint` on every push
• build-snapshot: `task snapshot` (test release, no publish)
• build-release: `task release` on Git tags
• coverage: Optional (currently commented out)
[If existingMise == false:]
✅ mise.toml (created — pins go/task/golangci-lint/goreleaser for dev + CI)
[If existingMise == true:]
ℹ️ mise.toml already exists — preserved (pipeline will use it as-is)
[If existingGitlabCi == true:]
⚠️ WARNING: .gitlab-ci.yml already exists and will be overwritten
[If goreleaserMissing == true:]
⚠️ NOTE: .goreleaser.yml not found
The snapshot/release jobs require this file to function.
Generate with: /gen-goreleaser
Dry run mode:
If dryRunMode == true:
Confirmation logic:
If --force flag provided: Skip confirmation, proceed to Phase 5
If existing .gitlab-ci.yml without --force:
Use AskUserQuestion:
Question: ".gitlab-ci.yml already exists. Overwrite existing pipeline configuration?"
Options:
1. "Yes, overwrite file" [Recommended if upgrading pipeline]
2. "Show full preview first"
3. "Cancel"
If option 2: Display full content preview, then re-ask confirmation
If option 3: Exit gracefully
If no .gitlab-ci.yml exists:
Use AskUserQuestion:
Question: "Create .gitlab-ci.yml at project root?"
Options:
1. "Yes, create file"
2. "Show preview first"
3. "Cancel"
File writing:
mise.toml [Only if existingMise == false]
mise.tomlexistingMise == true: skip (preserve the project's existing tool pins).gitlab-ci.yml
.gitlab-ci.ymlError handling:
.gitlab-ci.yml succeeds)Post-creation validation: confirm .gitlab-ci.yml exists and is non-zero; on failure
report the error and exit.
Report to the user — cover these facts; no fixed layout required:
.gitlab-ci.yml, and mise.toml marked as created vs. preserved.jdx/mise:latest →
mise install → task ...: unit-tests (task test) and linter (task lint) on every
push, build-snapshot (task snapshot, no publish), build-release (task release) on
git tags, and coverage (commented out by default).mise.toml was created, the pinned Go version (from go.mod),
golangci-lint version and goreleaser version.tags: [gitlab-org-docker] on every job with the project's own runner tags, found under
GitLab Settings → CI/CD → Runners (commonly docker, linux, kubernetes).mise.toml, not the pipeline YAML —
editing it changes both local (mise install) and CI versions. The coverage: job can be
uncommented (with coverage exclusions configured if needed). To publish Docker images,
uncomment the docker tools (buildx, docker-cli) in mise.toml and the .docker-dind block
in .gitlab-ci.yml, then extends: it from the release jobs — it authenticates with
CI_REGISTRY / CI_JOB_TOKEN..goreleaser.yml exists, say the release jobs are ready. If it
is missing, warn that build-snapshot and build-release will both fail, and point at
/gen-goreleaser or https://goreleaser.com/quick-start/..goreleaser.yml with /gen-goreleaser. "task/mise: command not found" → jobs run in
jdx/mise:latest and call mise install in before_script, so mise.toml must exist at
the repo root (this skill creates it). "Docker login failed" (only with the optional
docker block) → enable the Container Registry under Settings → General → Visibility and
confirm .docker-dind is uncommented and extended by the release jobs..gitlab-ci.yml (runner tags) and mise.toml (versions), ensure
.goreleaser.yml exists, then git add .gitlab-ci.yml mise.toml and
git commit -m "ci: add mise-based GitLab CI/CD pipeline", git push origin main, and
confirm the pipeline runs under CI/CD → Pipelines..gitlab-ci.yml · /gen-goreleaser for .goreleaser.yml ·
runner configuration under GitLab Settings → CI/CD → Runners.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).
Arguments are parsed from the argument string parameter:
--force: Skip confirmation prompt and overwrite existing file
--dry-run: Preview file without writing to disk
Parsing example:
argument = "--force"
Split by space, check for each flag:
- forceMode = true
- dryRunMode = false
Not a Git repository:
❌ Error: Not a git repository
This skill requires a Git repository. Initialize one:
git init
git add .
git commit -m "Initial commit"
Not a Go project:
❌ Error: go.mod not found
This skill is for Go projects only. Initialize a Go module:
go mod init gitlab.com/username/project
Skill assets missing:
❌ Error: Skill assets directory not found
The go-specialist plugin may be corrupted. Try:
1. Reinstalling the plugin
2. Updating Claude Code to latest version
3. Reporting issue at: https://github.com/sgaunet/claude-plugins/issues
Existing .gitlab-ci.yml:
--force: Request user confirmation--force: Overwrite silentlyMissing .goreleaser.yml:
/gen-goreleaser skillIf file write fails:
❌ Error: Failed to write .gitlab-ci.yml
Check:
1. Current directory is writable
2. Sufficient disk space
3. No file system restrictions
Current permissions: [show with ls -ld .]
| Source Path | Target (Relative to CWD) | Mode |
|---|---|---|
${CLAUDE_PLUGIN_ROOT}/assets/gitlab-ci/.gitlab-ci.yml | .gitlab-ci.yml | Always |
${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.toml | mise.toml | Create-if-missing |
Works with:
/commit: Commit generated .gitlab-ci.yml/gen-goreleaser: Generate .goreleaser.yml config (required for release/snapshot jobs)/create-issue: Create issue to track customization tasksTypical Workflow:
# 1. Generate dev tooling first (Taskfile.yml + mise.toml)
/gen-taskfiles
# 2. Generate GitLab CI configuration (reuses mise.toml; creates it if missing)
/gen-gitlab-ci
# 3. Generate GoReleaser config (required)
/gen-goreleaser
# 4. Customize files
# Edit .gitlab-ci.yml: Update runner tags
# Edit mise.toml: Adjust tool versions if needed
# 5. Commit everything
git add .gitlab-ci.yml mise.toml Taskfile*.yml .goreleaser.yml
git commit -m "ci: add mise-based GitLab CI/CD pipeline"
# 5. Push and verify
git push origin main
# Check: GitLab → CI/CD → Pipelines
Required for pipeline to function:
mise.toml (auto-created by this skill if missing):
mise install in every job/gen-taskfilesTaskfile.yml with test, lint, snapshot, release tasks:
/gen-taskfiles (also emits mise.toml).goreleaser.yml configuration:
/gen-goreleaser (required for build-snapshot and build-release)GitLab Runner that can run container images:
Optional enhancements:
Coverage reporting:
coverage: job in .gitlab-ci.ymlDocker image publishing:
.docker-dind block and extends: it from the release jobsCustom tag patterns:
rules: - if: $CI_COMMIT_TAG to filter specific tag patternsAll template files include # CUSTOMIZE: comments marking required changes:
mise.toml:
go, golangci-lint, goreleaser) → adjust as needed (used by dev + CI)buildx, docker-cli) → uncomment if publishing images.gitlab-ci.yml:
tags: [gitlab-org-docker] (one per job) → Replace with your runner tagscoverage: job → Uncomment to enable (configure exclusions if needed).docker-dind block → Uncomment + extends: from release jobs to publish imagesrules: in the build-release jobBefore running this skill:
After generation:
# CUSTOMIZE: comments in .gitlab-ci.yml/gen-goreleaser skillOngoing maintenance:
This skill does NOT:
/gen-goreleaser skill)/gen-taskfiles, which also manages mise.toml)--force to overwrite)Scope boundaries:
.gitlab-ci.yml (and creates mise.toml when missing)# Standard generation
/gen-gitlab-ci
# Preview before creating
/gen-gitlab-ci --dry-run
# Overwrite existing pipeline
/gen-gitlab-ci --force
# Force with dry run (preview what would be overwritten)
/gen-gitlab-ci --force --dry-run
Standard mode (default):
Dry run mode (--dry-run):
What SKILL.md sets; muted values are Claude Code's defaults
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-goreleaserGenerate GoReleaser configuration with multi-arch Docker builds and release automation/gen-linterGenerate .golangci.yml configuration for Go linting with 90+ lintersnpx claudepluginhub sgaunet/claude-plugins --plugin go-specialistOther plugins' skills for the same job