MCP HubMCP Hub
SKILL·51397A

go-dependency-audit

eduardo-sl
업데이트됨 22 days ago
5 조회
68
9
68
GitHub에서 보기
디자인general

정보

이 스킬은 Go 모듈 의존성을 감사하여 오래된 패키지를 탐지하고, 알려진 취약점을 확인하며, go.mod 파일의 상태를 점검합니다. 사용하지 않는 의존성을 식별하고, 의존성 품질을 평가하며, govulncheck와 같은 도구를 이용한 취약점 스캔을 수행하는 데 도움을 줍니다. go.mod 정리, 모듈 업그레이드, 또는 서드파티 패키지 위험 평가 시 활용하세요.

빠른 설치

Claude Code

추천
기본
npx skills add eduardo-sl/go-agent-skills -a claude-code
플러그인 명령대체
/plugin add https://github.com/eduardo-sl/go-agent-skills
Git 클론대체
git clone https://github.com/eduardo-sl/go-agent-skills.git ~/.claude/skills/go-dependency-audit

Claude Code에서 이 명령을 복사하여 붙여넣어 스킬을 설치하세요

문서

Go Dependency Audit

Every dependency you add is code you don't control but are responsible for. Audit ruthlessly.

1. Vulnerability Scanning

govulncheck (official Go tool):

# Install
go install golang.org/x/vuln/cmd/govulncheck@latest

# Scan project
govulncheck ./...

# Scan binary
govulncheck -mode=binary ./cmd/api-server

govulncheck checks against the Go vulnerability database and reports only vulnerabilities that actually affect your code paths — not just transitive deps you never call.

Run this in CI. No exceptions.

Additional scanning:

# Nancy (Sonatype OSS Index)
go list -json -deps ./... | nancy sleuth

# Trivy (container + deps)
trivy fs --scanners vuln .

2. go.mod Hygiene

Check for unused dependencies:

go mod tidy
git diff go.mod go.sum  # any changes = deps were stale

go mod tidy MUST be run before every commit. Add to CI:

go mod tidy
git diff --exit-code go.mod go.sum

No replace directives in committed code:

// ❌ Bad — committed replace directive
replace github.com/foo/bar => ../local-bar

// ✅ Acceptable — in monorepos with workspace
// go.work handles this instead

Exception: temporary replace for bug fixes with a comment and linked issue:

// TODO(#1234): remove after upstream merges fix
replace github.com/foo/bar => github.com/myorg/bar v0.0.0-fix

Verify checksums:

go mod verify

This confirms that downloaded modules match their expected checksums. Failures indicate supply-chain tampering.

3. Dependency Evaluation Criteria

Before adding any dependency, evaluate:

CriterionCheck
MaintenanceLast commit < 6 months? Active issue responses?
PopularityStars/forks alone mean nothing. Usage in production projects matters.
LicenseCompatible with your project? MIT/Apache/BSD preferred.
SizeDoes it pull in 50 transitive deps for one function?
AlternativesCan you do this with stdlib in < 50 lines?
API stabilityIs it v1+? Does it follow semver? Frequent breaking changes?
Test coverageDoes the project have meaningful tests?

The stdlib question:

Go's standard library is excellent. Before adding a dependency, ask: "Can I solve this with net/http, encoding/json, database/sql, text/template, crypto/*, os/exec, etc.?"

If the answer is yes and the code is < 100 lines, write it yourself.

4. Module Version Audit

List all dependencies with versions:

go list -m all

Check for available updates:

go list -m -u all  # shows available updates

Upgrade strategy:

# Update specific module
go get github.com/foo/bar@latest

# Update all direct deps (minor/patch only)
go get -u ./...

# Update all deps including major versions (dangerous)
go get -u -t ./...

ALWAYS run full test suite after updates:

go get github.com/foo/[email protected]
go mod tidy
go test -race ./...

5. Transitive Dependency Analysis

# Why is this module in my dependency tree?
go mod why github.com/some/transitive-dep

# Full dependency graph
go mod graph

# Visual dependency graph (with modgraphviz)
go mod graph | modgraphviz | dot -Tpng -o deps.png

Watch for:

  • 🔴 Transitive deps with known CVEs
  • 🔴 Abandoned transitive deps (no commits in 2+ years)
  • 🟡 Diamond dependency conflicts (two versions of same module)
  • 🟡 Oversized transitive trees (a logging library pulling in gRPC)

6. Go Version Management

// go.mod
module github.com/myorg/myproject

go 1.22  // minimum Go version required

Rules:

  • Set go directive to the minimum version that supports features you use.
  • toolchain directive (Go 1.21+) pins the exact toolchain version.
  • Test against multiple Go versions in CI (at minimum: current and previous).

7. Recommended vs. Avoid

Well-maintained, production-proven packages:

DomainPackage
Logginggo.uber.org/zap, log/slog (stdlib 1.21+)
HTTP Routergithub.com/go-chi/chi, net/http (1.22+ routing)
Configgithub.com/caarlos0/env, github.com/spf13/viper
Testinggithub.com/stretchr/testify, stdlib testing
Databasegithub.com/jackc/pgx, github.com/jmoiron/sqlx
Validationgithub.com/go-playground/validator
UUIDgithub.com/google/uuid
Errorsgo.uber.org/multierr, stdlib errors (1.20+)

Patterns to avoid:

  • ❌ Frameworks that take over main() (Go is not Java Spring)
  • ❌ ORMs that hide SQL (prefer sqlx or raw database/sql)
  • ❌ Code generators you don't understand
  • ❌ Packages with v0.x that have been v0 for 3+ years

Audit Output Format

## Dependency Audit Report

**Module:** github.com/myorg/myproject
**Go version:** 1.22
**Direct deps:** N | **Indirect deps:** M

### 🔴 Vulnerabilities
- CVE-XXXX-YYYY in github.com/foo/[email protected] — upgrade to v1.2.5

### 🟡 Outdated Dependencies
- github.com/foo/bar v1.2.3 → v1.5.0 available (minor)

### 🟢 Observations
- go.mod is clean, no replace directives
- All deps actively maintained

GitHub 저장소

eduardo-sl/go-agent-skills
경로: skills/(workflow)/go-dependency-audit
0
FAQ

자주 묻는 질문

go-dependency-audit Skill이란 무엇인가요?

go-dependency-audit은(는) eduardo-sl이(가) 만든 Claude Skill입니다. Skill은 Claude가 필요할 때 불러오는 지침과 리소스를 묶어 추가 프롬프트 없이 go-dependency-audit 관련 작업을 수행할 수 있게 합니다.

go-dependency-audit은(는) 어떻게 설치하나요?

이 페이지의 설치 명령을 사용하세요. go-dependency-audit을(를) Claude Code 플러그인으로 추가하거나 저장소를 skills 디렉터리에 복제한 다음 Claude를 다시 시작해 Skill을 불러옵니다.

go-dependency-audit은(는) 어떤 카테고리에 속하나요?

go-dependency-audit은(는) 디자인 카테고리에 속합니다.

go-dependency-audit은(는) 무료로 사용할 수 있나요?

네. go-dependency-audit은(는) AIMCP에 등록되어 있으며 무료로 설치할 수 있습니다.

연관 스킬

executing-plans
디자인

executing-plans 스킬은 검토 체크포인트가 포함된 통제된 배치로 실행할 완전한 구현 계획이 있을 때 사용합니다. 이 스킬은 계획을 불러와 비판적으로 검토한 후, 소규모 배치(기본값 3개 작업)로 작업을 실행하면서 각 배치 사이에 진행 상황을 아키텍트 검토를 위해 보고합니다. 이를 통해 내재된 품질 관리 체크포인트를 갖춘 체계적인 구현이 보장됩니다.

스킬 보기
requesting-code-review
디자인

이 스킬은 코드 변경 사항을 요구 사항에 따라 분석하기 위해 코드 리뷰어 하위 에이전트를 호출합니다. 작업 완료 후, 주요 기능 구현 후, 또는 메인 브랜치에 병합하기 전에 사용해야 합니다. 이 리뷰는 현재 구현체와 원래 계획을 비교하여 문제를 조기에 발견하는 데 도움이 됩니다.

스킬 보기
connect-mcp-server
디자인

이 스킬은 개발자들이 HTTP, stdio 또는 SSE 전송 방식을 통해 MCP 서버를 Claude Code에 연결하는 포괄적인 가이드를 제공합니다. GitHub, Notion 및 사용자 정의 API와 같은 외부 서비스를 통합하기 위한 설치, 구성, 인증 및 보안을 다룹니다. MCP 통합 설정, 외부 도구 구성 또는 Claude의 모델 컨텍스트 프로토콜 작업 시 활용하세요.

스킬 보기
web-cli-teleport
디자인

이 스킬은 작업 분석을 기반으로 개발자가 Claude Code 웹 인터페이스와 CLI 인터페이스 중 선택할 수 있도록 돕고, 두 환경 간 원활한 세션 텔레포트를 가능하게 합니다. 웹, CLI 또는 모바일 환경 전환 시 세션 상태와 컨텍스트를 관리하여 워크플로를 최적화합니다. 다양한 단계에서 서로 다른 도구가 필요한 복잡한 프로젝트에 사용하세요.

스킬 보기