MCP HubMCP Hub
SKILL·3C21DE

go-code-review

eduardo-sl
업데이트됨 22 days ago
5 조회
68
9
68
GitHub에서 보기
테스팅testing

정보

이 스킬은 관용적인 패턴, 오류 처리, 테스트 커버리지에 초점을 맞춘 Go 코드 검토를 위한 구조화된 체크리스트를 제공합니다. 변경 사항(PR 등) 또는 전체 파일/패키지 검토 모드로 작동합니다. 보안이나 성능 특화 감사가 아닌 일반적인 코드 품질 검토에 사용하세요.

빠른 설치

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-code-review

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

문서

Go Code Review

Structured code review process for Go. Reviews should be constructive, specific, and cite the relevant principle behind each finding.

Operating Modes

Pick the mode that matches the request before starting:

  • Diff review (default) — review only the changed lines plus enough surrounding context to judge them. Use for PRs and working-tree changes.
  • File/package review — review the named files or packages in full, including their tests.
  • Full audit — sweep the entire codebase. Use the strategy in "Auditing Large Codebases" below and aggregate everything into one report.

Review Process

Execute these steps in order. For each finding, classify severity:

  • 🔴 BLOCKER — Must fix before merge. Correctness, data loss, security.
  • 🟡 WARNING — Should fix. Maintainability, idiomatic Go, clarity.
  • 🟢 SUGGESTION — Consider improving. Style, naming, documentation.

0. Run the Toolchain First

Before reading code manually, let the tools catch the mechanical issues (skip any tool that is not installed and note it in the report):

go build ./...          # it must compile
go vet ./...            # suspicious constructs
golangci-lint run       # if the repo has a config
go test -race ./...     # tests pass, no data races

Report tool findings alongside manual findings — a failing go vet is an automatic 🔴 BLOCKER. Never report an issue a tool already proves absent.

1. Correctness & Safety

Error Handling

  • Every error is checked. No blank identifier _ discarding errors silently.
  • Errors are wrapped with context: fmt.Errorf("fetch user %d: %w", id, err).
  • Error values compared with errors.Is() / errors.As(), never ==.
  • No panic outside of init() or truly unrecoverable situations.
  • Errors handled exactly once — no log-and-return patterns.

Nil Safety

  • Pointer receivers checked before dereference when nil is a valid state.
  • Map reads guarded or use comma-ok idiom.
  • Channel operations consider closed/nil channels.
  • Slice operations check bounds where relevant.

Concurrency

  • Shared mutable state protected by sync.Mutex or channels.
  • No goroutine leaks — every goroutine has a clear termination path.
  • Context propagation: all blocking calls accept and respect context.Context.
  • sync.WaitGroup or errgroup.Group used for goroutine lifecycle.

2. API Design

  • Exported functions have doc comments starting with the function name.
  • Accept interfaces, return concrete types.
  • Use functional options (WithTimeout(d)) over config structs for optional params.
  • Context is always the first parameter: func Foo(ctx context.Context, ...).
  • Return error as the last return value.
  • Avoid bool parameters — prefer named types or options.

3. Idiomatic Go

  • Uses := for local variables, var for zero-value intent.
  • No unnecessary else after return/continue/break.
  • Guard clauses and early returns reduce nesting.
  • defer used for cleanup, placed right after resource acquisition.
  • range used over manual index iteration where appropriate.
  • Struct literals use field names.
  • Interfaces defined at consumer, not producer.

4. Package Structure

  • Package names are short, lowercase, singular nouns.
  • No circular dependencies between packages.
  • internal/ used for non-public packages.
  • cmd/ contains main packages, one per binary.
  • Clear separation of concerns — no god packages.

5. Testing

  • Test functions follow TestXxx naming convention.
  • Table-driven tests used for multiple input/output combinations.
  • Test helpers use t.Helper() for clean stack traces.
  • No test logic in init() — use TestMain when needed.
  • Tests use testify/assert or testify/require consistently, or stdlib only.
  • Edge cases covered: empty input, nil, zero values, max values.
  • t.Parallel() used where safe.

6. Documentation

  • All exported types, functions, and constants have doc comments.
  • Doc comments start with the name of the entity.
  • Package-level doc comment in doc.go for non-trivial packages.
  • Complex algorithms or business logic have inline comments explaining why.

7. Dependencies

  • go.mod has no replace directives in committed code (except monorepos).
  • No unused dependencies.
  • Dependencies are from well-maintained, reputable sources.
  • Indirect dependencies are understood and acceptable.

Auditing Large Codebases

When the scope exceeds ~20 files, do not read everything in one linear pass. Split the audit into independent passes:

  1. Enumerate packages (go list ./...) and group them by layer (handlers, services, stores, shared libraries).
  2. Run one focused pass per concern from sections 1-7 (correctness, API design, idioms, structure, testing, docs, dependencies).
  3. If your environment supports delegating work to parallel sub-agents or tasks, assign each pass to one — they are independent by design. Otherwise run them sequentially, one concern at a time.
  4. Require every finding to cite file.go:line and severity so the final aggregation is mechanical: merge, deduplicate, sort by severity.

Review Output Format

## Code Review Summary

**Files reviewed:** <list>
**Overall assessment:** APPROVE | REQUEST CHANGES | COMMENT

### Findings

#### 🔴 BLOCKER: <title>
- **File:** `path/to/file.go:42`
- **Issue:** <what is wrong>
- **Why:** <which principle or guideline>
- **Fix:** <concrete suggestion>

#### 🟡 WARNING: <title>
...

#### 🟢 SUGGESTION: <title>
...

### What's Done Well
<genuine positive observations — always include at least one>

GitHub 저장소

eduardo-sl/go-agent-skills
경로: skills/(code-quality)/go-code-review
0
FAQ

자주 묻는 질문

go-code-review Skill이란 무엇인가요?

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

go-code-review은(는) 어떻게 설치하나요?

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

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

go-code-review은(는) 테스팅 카테고리에 속합니다.

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

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

연관 스킬

evaluating-llms-harness
테스팅

이 Claude Skill은 MMLU, GSM8K를 포함한 60개 이상의 표준화된 학술 과제에서 LLM 성능을 벤치마크하기 위해 lm-evaluation-harness를 실행합니다. 개발자들이 모델 품질을 비교하고, 학습 진행 상황을 추적하거나 학술 결과를 보고할 수 있도록 설계되었습니다. 이 도구는 HuggingFace와 vLLM 모델을 포함한 다양한 백엔드를 지원합니다.

스킬 보기
cloudflare-cron-triggers
테스팅

이 스킬은 cron 표현식을 사용하여 Worker를 스케줄링하기 위한 Cloudflare Cron Triggers 구현에 관한 포괄적인 지식을 제공합니다. 주기적 작업, 유지보수 작업, 자동화된 워크플로우 설정 방법을 다루며, 잘못된 cron 표현식이나 시간대 문제 같은 일반적인 이슈들을 해결하는 방법을 포함합니다. 개발자들은 이를 통해 스케줄된 핸들러 구성, cron 트리거 테스트, Workflows 및 Green Compute와의 연동 작업을 수행할 수 있습니다.

스킬 보기
webapp-testing
테스팅

이 Claude Skill은 Python 스크립트를 통해 로컬 웹 애플리케이션을 테스트하기 위한 Playwright 기반 툴킷을 제공합니다. 프론트엔드 검증, UI 디버깅, 스크린샷 캡처, 로그 확인 기능을 지원하며 서버 라이프사이클을 관리합니다. 브라우저 자동화 작업에 사용하되 컨텍스트 오염을 방지하기 위해 소스 코드를 읽지 않고 스크립트를 직접 실행하세요.

스킬 보기
finishing-a-development-branch
테스팅

이 스킬은 테스트 통과를 확인한 후 체계적인 통합 옵션을 제시하여 개발자가 완성된 작업을 마무리하도록 돕습니다. 구현이 완료된 후 머지, PR 생성, 브랜치 정리와 같은 워크플로우를 안내합니다. 코드가 준비되고 테스트가 완료되었을 때 개발 프로세스를 체계적으로 마무리하기 위해 사용하세요.

스킬 보기