Go modules and dependency management
Manages Go modules and dependencies including initialization, tidy, vendor, and updates. Triggers when you need to initialize modules, clean up dependencies, or update Go packages.
/plugin marketplace add pluginagentmarketplace/custom-plugin-go/plugin install go-development-assistant@pluginagentmarketplace-goThis skill inherits all available tools. When active, it can use any tool Claude has access to.
assets/config.yamlassets/go-mod-commands.yamlassets/schema.jsonreferences/GUIDE.mdreferences/PATTERNS.mdscripts/validate.pyMaster Go module system and dependency management.
Complete guide for Go modules including versioning, private modules, vendoring, and dependency updates.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| action | string | yes | - | Action: "init", "tidy", "vendor", "update" |
| private | bool | no | false | Handle private modules |
# Initialize new module
go mod init github.com/myorg/myapp
# Download dependencies
go mod download
# Cleanup unused dependencies
go mod tidy
# Verify dependencies
go mod verify
module github.com/myorg/myapp
go 1.22
require (
github.com/gin-gonic/gin v1.9.1
github.com/jmoiron/sqlx v1.3.5
go.uber.org/zap v1.26.0
)
require (
// indirect dependencies auto-managed
github.com/lib/pq v1.10.9 // indirect
)
# Configure private module pattern
go env -w GOPRIVATE=github.com/myorg/*
# Use SSH for private repos
git config --global url."git@github.com:".insteadOf "https://github.com/"
# Or use access token
git config --global url."https://${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
# Create vendor directory
go mod vendor
# Build with vendor
go build -mod=vendor ./...
# Verify vendor is in sync
go mod verify
# List available updates
go list -m -u all
# Update specific dependency
go get github.com/gin-gonic/gin@latest
# Update all dependencies
go get -u ./...
# Update to specific version
go get github.com/gin-gonic/gin@v1.9.1
# Downgrade
go get github.com/gin-gonic/gin@v1.8.0
// go.mod
// Local development
replace github.com/myorg/shared => ../shared
// Fork with fixes
replace github.com/original/pkg => github.com/myorg/pkg-fork v1.2.3
// Exclude vulnerable version
exclude github.com/vulnerable/pkg v1.0.0
// go.work
go 1.22
use (
./api
./shared
./worker
)
# Initialize workspace
go work init ./api ./shared
# Add module to workspace
go work use ./worker
# Sync workspace
go work sync
| Symptom | Cause | Fix |
|---|---|---|
| Module not found | Private repo | Set GOPRIVATE |
| Checksum mismatch | Proxy cache | GOPROXY=direct |
| Version conflict | Diamond dependency | Use go mod graph |
go mod graph # Show dependency graph
go mod why github.com/pkg/errors # Why is this needed?
go list -m -versions github.com/gin-gonic/gin # Available versions
Skill("go-modules")
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.