go-code-review

Installation
SKILL.md

Go Backend PR Review

Thoroughly review Go backend code changes in Bythen repositories. Focus on real bugs and actionable findings — not style nitpicks.

Review Workflow

  1. Fetch the PR diff using gh pr diff <number>
  2. Read full files for every changed file (not just the diff) to understand context
  3. Cross-reference layers — check handler, service, repository, entity, router, and wire container together
  4. Classify findings by severity and report

Issue Categories

Report findings in this order:

Severity Icon What to look for
Bug 🔴 Confirmed bugs — wrong behavior, data corruption, panics
Potential Bug 🟡 Logic that will break under certain conditions
Anomaly 🟡 Unusual patterns that suggest copy-paste or misunderstanding
Redundant 🔵 Dead code, stale comments, leftover debug artifacts

What to Check — Load References as Needed

Area When to load Reference
Error handling, binding, apierror codes Handler/service errors, ShouldBind* usage references/error-handling.md
Nil slice, struct tags, route schema, count queries Repository or handler changes references/common-mistakes.md
Goroutines, channels, race conditions, mutex Any goroutine, shared state, or async code references/concurrency.md
Architecture, layer conventions, wire DI Unfamiliar pattern or new domain references/bythen-architecture.md

Bythen Architecture Quick Reference

handler (assetapi/)     → binds request, validates, calls service
service (assetsvc/)     → business logic, maps entity ↔ repo types
repository (asset/)     → builds SQL via go-core/db/query, scans rows
entity (entity/)        → request/response DTOs with validation
router (router/)        → registers routes with schema + auth
container (container/)  → wire DI wiring
  • Query builder: github.com/tanookiai/go-core/db/querySelect().From().Where().Limit().Offset()
  • Validation: github.com/tanookiai/go-core/validation — structs implement Validate(v *validation.Validator)
  • Error codes: apierror.Error("0500", err) or apierror.Get("0400").Message(msg)
  • Pagination: pagination.NewPagination(page, limit, total)
  • Mocks: mockery-generated, in mock/repository/db/

Verification Protocol

Before reporting any issue, verify:

  1. Read the actual code — do not report from diff alone; load the full file
  2. Confirm it's not a framework convention — check if go-core handles the pattern differently
  3. Check if the pattern exists elsewhere — if the same pattern is used in merged code, it may be intentional
  4. Assess real impact — only report if it causes incorrect behavior, data loss, or maintenance risk

Output Format

## PR #N Review: `<pr-title>`

### 🔴 Bugs

**1. Short title (`file:line`)**
[Code block showing the problem]
[Explanation of actual impact]

---

### 🟡 Potential Bugs / Anomalies

**N. Short title (`file:line`)**
[Explanation]

---

### 🔵 Redundant / Minor

**N. Short title (`file:line`)**
[Explanation]

---

### Summary

| Severity | Count | Issues |
|----------|-------|--------|
| 🔴 Bug | N | brief list |
| 🟡 Anomaly | N | brief list |
| 🔵 Minor | N | brief list |
Related skills

More from sultanfarizbythen/skills

Installs
9
First Seen
Mar 13, 2026