Solizardking/clawd-bot / .agents/skills/golang-dependency-management
golang-dependency-management
VerifiedDependency management strategies for Golang projects — go.mod management, installing/upgrading packages, Minimal Version Selection, vulnerability scanning, outdated dependency tracking, binary size analysis, Dependabot/Renovate setup, conflict resolution, and go.work workspaces. Use when adding, removing, or upgrading Go dependencies, auditing vulnerabilities, resolving version conflicts, or setting up automated dependency updates.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 9.7 KB |
| evals/evals.json | config | 11.2 KB |
| references/auditing.md | markdown | 3.4 KB |
| references/automated-updates.md | markdown | 1.8 KB |
| references/conflicts.md | markdown | 2.1 KB |
| references/versioning.md | markdown | 2.7 KB |
| references/visualization.md | markdown | 1.4 KB |
| references/workspaces.md | markdown | 1.2 KB |
references/conflicts.md
View on GitHub# Dependency Conflicts & Resolution
## Diagnosing Conflicts
```bash
# See why a module is in your build
go mod why -m github.com/some/module
# See which version is selected
go list -m github.com/some/module
# See the full requirement graph
go mod graph
# List all modules in the build
go list -m all
```
## Resolution Strategies
**Force a specific version** (when two deps require incompatible versions):
```bash
go mod edit -replace=example.com/pkg@v1.2.0=example.com/pkg@v1.3.1
```
```go
// go.mod
replace example.com/pkg v1.2.0 => example.com/pkg v1.3.1
```
**Use a local fork** (for debugging or patching):
```go
replace example.com/pkg => ../my-local-fork
```
**Block a problematic version**:
```bash
go mod edit -exclude=example.com/pkg@v1.3.0
```
When a version is excluded, any requirement on that version is redirected to the next higher available version.
**Force upgrade a transitive dependency**:
```bash
go get github.com/transitive/dep@v1.5.0
```
This adds an explicit requirement in your `go.mod`, overriding whatever the transitive dependency chain would select via MVS.
## Resolution Workflow
1. Run `go mod graph` and `go mod why -m <module>` to understand the dependency chain
2. Identify which of your direct dependencies pulls in the conflicting version
3. Try upgrading the direct dependency first: `go get github.com/direct/dep@latest`
4. If that doesn't resolve it, use `replace` or `exclude` as a temporary fix
5. Run `go mod tidy` to clean up
6. Verify with `go build ./...` and `go test ./...`
**Important**: `replace` and `exclude` directives only take effect in the **main module's** `go.mod`. They are ignored when your module is used as a dependency. Remove `replace` directives before publishing a library.
## Retract (For Module Authors)
Mark versions as broken or accidentally published:
```go
// go.mod
retract v1.0.0 // Contains critical bug in auth
retract [v1.1.0, v1.2.0] // Range of broken versions
```
Retracted versions are still downloadable but `go get` will not select them by default, and `go list -m -u` warns about them.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |