/go-specialist:gen-taskfiles [--force] [--dry-run]from go-specialist
Generates mise.toml, Taskfile.yml, Taskfile_dev.yml, and .pre-commit-config.yaml for Go projects with task automation, linting, testing, building, and release workflows.
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 complete Task automation setup for Go projects including a mise.toml (development tool versions), the main Taskfile, development tasks, and pre-commit hooks configuration. This skill provides a comprehensive task runner setup with linting, testing, building, and release automation — and pins the tool versions so local development and CI stay in sync.
Problem: Setting up task automation for Go projects requires manually creating Taskfile configuration, understanding Task syntax, pinning tool versions, and configuring pre-commit hooks - a 20-30 minute process.
Solution: One-command generation that:
mise.toml, Taskfile.yml, Taskfile_dev.yml, .pre-commit-config.yamlmise.toml (go, task, golangci-lint, goreleaser) so local dev and CI use identical versionsmise.toml is the single source of truth for tool versions. It is consumed by the CI generators (/gen-github-dir, /gen-forgejo-dir, /gen-gitlab-ci), whose workflows install tools via mise and then run task …. See https://mise.jdx.dev.
CRITICAL: When generating any content (taskfiles, 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 taskfiles:
test -f mise.toml
test -f Taskfile.yml
test -f Taskfile_dev.yml
test -f .pre-commit-config.yaml
existingFiles = []hasExistingFiles = truemise.toml separately as existingMise = true|false (a pre-existing
mise.toml already pins tool versions; default to preserving it unless --force).Verify skill assets directory:
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/Taskfile.yml exists${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.toml existsCheck for supporting configs (non-blocking):
test -f .golangci.yml
test -f .goreleaser.yml
linterMissing = true (warn in Phase 6)goreleaserMissing = true (warn in Phase 6)Parse skill arguments from $argument string:
Supported flags:
--force: Skip confirmation for existing files--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 == "--dry-run": set dryRunMode = true
Read all template files from skill assets directory:
Files to read:
mise.toml
${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.tomlmise.toml (project root)Taskfile.yml (66 lines)
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/Taskfile.ymlTaskfile.yml (project root)Taskfile_dev.yml (14 lines)
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/Taskfile_dev.ymlTaskfile_dev.yml (project root).pre-commit-config.yaml (25 lines)
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/.pre-commit-config.yaml.pre-commit-config.yaml (project root)Template handling:
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_go_version, detect_golangci_lint_version, detect_goreleaser_version, strip_leading_v, substitute_placeholders, substitute_version_placeholders).
Detection Workflow:
Detect all values:
PROJECT_NAME=$(detect_project_name)
OWNER=$(detect_git_owner)
REGISTRY=$(detect_registry)
MAIN_DIR=$(detect_main_dir)
Detect tool versions for mise.toml:
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}")
mise.toml uses the bare golangci-lint version (no leading v), the
v-prefixed goreleaser tag, and major.minor Go from go.mod.Handle missing critical values:
PROJECT_NAME is empty: Use "app" as defaultOWNER is empty: Preserve [OWNER] placeholderSubstitute placeholders in Taskfile.yml template:
taskfile_template=$(substitute_placeholders "$taskfile_template" \
"$PROJECT_NAME" "$OWNER" "$REGISTRY" "$MAIN_DIR")
Detect pre-commit-hooks version:
PRE_COMMIT_HOOKS_VERSION=$(detect_pre_commit_hooks_version)
v4.3.0Substitute version placeholders in .pre-commit-config.yaml template:
precommit_template=$(substitute_version_placeholders "$precommit_template" \
"PRE_COMMIT_HOOKS_VERSION=${PRE_COMMIT_HOOKS_VERSION:-v4.3.0}")
Note: Taskfile_dev.yml has no placeholders
Build preview summary:
Files to be created:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅ mise.toml - Pinned dev tool versions (go, task, golangci-lint, goreleaser)
✅ Taskfile.yml (66 lines) - Main task definitions
✅ Taskfile_dev.yml (14 lines) - Development tasks
✅ .pre-commit-config.yaml (25 lines) - Git pre-commit hooks
Total: 4 files
[If existingMise == true and not --force:]
ℹ️ mise.toml already exists — it will be PRESERVED (your tool pins are kept).
✅ Auto-detected Configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Project Settings:
• Project name: <PROJECT_NAME> (from go.mod)
• Binary name: <PROJECT_NAME>
• Main directory: <MAIN_DIR>
Tool Versions (mise.toml):
• Go: <GO_VERSION> (from go.mod)
• golangci-lint: <GOLANGCI_LINT_VERSION_BARE>
• goreleaser: <GORELEASER_VERSION>
• task: latest
Repository Settings:
• Owner: <OWNER> (from git remote)
• Registry: <REGISTRY>
Task Categories:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🔧 Development:
- default: List all available tasks
- check-before-commit: Run all quality checks
- lint: Run golangci-lint
- test: Run unit tests with race detection
- build: Build project binaries
📦 Release:
- snapshot: Create snapshot release (goreleaser)
- release: Create production release (goreleaser)
- image: Build and push Docker image
📚 Documentation:
- doc: Start godoc server
🛠️ Dev Tools (Taskfile_dev.yml):
- dev:install-pre-commit: Install pre-commit hooks
- dev:pre-commit: Run all pre-commit hooks manually
🎯 Pre-commit Hooks:
- check-yaml: Validate YAML syntax
- check-added-large-files: Prevent large files
- unit-tests: Run tests before commit
- lint: Run linter before commit
- build: Test build before commit
[If hasExistingFiles == true:]
⚠️ WARNING: Some files already exist and will be overwritten:
[List existing files]
Dry run mode:
If dryRunMode == true:
Confirmation logic:
If --force flag provided: Skip confirmation, proceed to Phase 5
If existing files without --force:
Use AskUserQuestion:
Question: "Task configuration files already exist. Overwrite?"
Options:
1. "Yes, overwrite files" [Recommended if upgrading]
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 existing files:
Use AskUserQuestion:
Question: "Create task configuration files (3 files)?"
Options:
1. "Yes, create files"
2. "Show preview first"
3. "Cancel"
File writing sequence:
Write files in order:
mise.toml
existingMise == true and --force was NOT
given, skip writing (keep the project's existing tool pins) and note it in
the report. With --force, overwrite like the other files.Taskfile.yml
BINFILE: gitlab-backup with detected binary nameTaskfile_dev.yml
.pre-commit-config.yaml
For each file:
Error handling:
Track results:
successfulFiles = []
failedFiles = []
for each file:
try write:
if success: add to successfulFiles
if failure: add to failedFiles
Post-creation validation: for each file in successfulFiles, confirm it exists and is
non-zero; move any failure to failedFiles.
Report to the user — cover these facts; no fixed layout required:
mise.toml as
created vs. preserved (an existing one is never overwritten).mise.toml, and the pre-commit hooks version.task or task -a lists everything; highlight task check-before-commit,
task lint, task test, task build, task snapshot, task release, task doc,
task dev:install-pre-commit, task dev:pre-commit.mise.toml, so mise is installed once per
machine (brew install mise, or curl https://mise.run | sh —
https://mise.jdx.dev/getting-started.html) and then provides go, task, golangci-lint and
goreleaser at the exact CI versions. Follow with mise install, plus either
mise activate <shell> in the shell rc or one-offs via mise exec -- task lint.
pre-commit installs separately (brew install pre-commit or pip install pre-commit),
then task dev:install-pre-commit.linterMissing, warn that .golangci.yml is absent and point at
/gen-linter; if goreleaserMissing, same for .goreleaser.yml and /gen-goreleaser.
Note that mise supplies both binaries either way — only the config is missing.trailing-whitespace and end-of-file-fixer hooks can be enabled; the
Docker image is already wired to <REGISTRY>/<OWNER>/<PROJECT_NAME>:latest and worth a
check.task dev:install-pre-commit, tested with
task dev:pre-commit, then run on every git commit — checking YAML syntax, large
files, unit tests, the linter and a snapshot build. git commit --no-verify bypasses
them in an emergency.mise install, review mise.toml and
Taskfile.yml, install the hooks, generate any missing config, run task lint,
task test and task build, then git add mise.toml Taskfile*.yml .pre-commit-config.yaml
and git commit -m "build: add mise, task automation and pre-commit hooks".task -a for the task list.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 files
--dry-run: Preview files 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 github.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 task files:
--force: Request user confirmation--force: Overwrite silentlyMissing .golangci.yml or .goreleaser.yml:
/gen-linter or /gen-goreleaser skillsIf file write fails:
❌ Error: Failed to write [filename]
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) | Lines | Purpose |
|---|---|---|---|
${CLAUDE_PLUGIN_ROOT}/assets/mise/mise.toml | mise.toml | ~35 | Pinned dev tool versions (preserve-if-exists) |
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/Taskfile.yml | Taskfile.yml | 66 | Main task definitions |
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/Taskfile_dev.yml | Taskfile_dev.yml | 14 | Development tasks |
${CLAUDE_PLUGIN_ROOT}/assets/taskfiles/.pre-commit-config.yaml | .pre-commit-config.yaml | 25 | Git pre-commit hooks |
Works with:
/commit: Commit generated taskfiles/gen-linter: Generate .golangci.yml (required for lint task)/gen-goreleaser: Generate .goreleaser.yml (required for snapshot/release tasks)/gen-github-dir: GitHub workflows can call task commands/gen-gitlab-ci: GitLab CI can call task commandsTypical Workflow:
# 1. Generate task configuration (also writes mise.toml)
/gen-taskfiles
# 2. Generate supporting configs
/gen-linter # Creates .golangci.yml
/gen-goreleaser # Creates .goreleaser.yml
# 3. Install tools (one mise install pins everything) and hooks
brew install mise pre-commit # or: curl https://mise.run | sh
mise install # installs go, task, golangci-lint, goreleaser
task dev:install-pre-commit
# 4. Test tasks
task lint
task test
task build
# 5. Commit everything
git add mise.toml Taskfile*.yml .pre-commit-config.yaml .golangci.yml .goreleaser.yml
git commit -m "build: add mise, task automation and pre-commit hooks"
# 6. Verify hooks work
# Make a test change, try to commit - hooks should run
default: List all available tasks
task -acheck-before-commit: Run complete quality check suite
lint: Run golangci-lint
golangci-lint runtest: Run unit tests with race detection
go test -count=2 -race ./...build: Build project binaries
image: Build and push Docker image
doc: Start godoc documentation server
godoc -http=:6060snapshot: Create snapshot release
goreleaser --clean --snapshotrelease: Create production release
goreleaser --cleandev:install-pre-commit: Install pre-commit hooks
pre-commit installdev:pre-commit: Run all pre-commit hooks manually
pre-commit run --all-files.pre-commit-config.yaml configures automatic quality checks:
Standard hooks (from pre-commit/pre-commit-hooks):
check-yaml: Validate YAML syntax (enabled)check-added-large-files: Prevent commits of large files (enabled)trailing-whitespace: Remove trailing whitespace (commented, can enable)end-of-file-fixer: Ensure files end with newline (commented, can enable)Local hooks (run task commands):
unit-tests: Run task test before commitlint: Run task lint before commitbuild: Run task snapshot before commitAll local hooks use pass_filenames: false to run full checks, not per-file.
Before running this skill:
After generation:
task dev:install-pre-committask lint, task test, task buildOngoing usage:
task check-before-commit before pushing codetask snapshot to test releases locallyThis skill does NOT:
/gen-linter skill)/gen-goreleaser skill)--force to overwrite)task dev:install-pre-commit)Scope boundaries:
# Standard generation (3 files)
/gen-taskfiles
# Preview before creating
/gen-taskfiles --dry-run
# Overwrite existing configuration
/gen-taskfiles --force
# Force with dry run
/gen-taskfiles --force --dry-run
Standard mode (default):
Dry run mode (--dry-run):
Why Task instead of Make?
Migration from Make: If you have a Makefile, you can:
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-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