go-code-review
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
- Fetch the PR diff using
gh pr diff <number> - Read full files for every changed file (not just the diff) to understand context
- Cross-reference layers — check handler, service, repository, entity, router, and wire container together
- 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/query—Select().From().Where().Limit().Offset() - Validation:
github.com/tanookiai/go-core/validation— structs implementValidate(v *validation.Validator) - Error codes:
apierror.Error("0500", err)orapierror.Get("0400").Message(msg) - Pagination:
pagination.NewPagination(page, limit, total) - Mocks: mockery-generated, in
mock/repository/db/
Verification Protocol
Before reporting any issue, verify:
- Read the actual code — do not report from diff alone; load the full file
- Confirm it's not a framework convention — check if go-core handles the pattern differently
- Check if the pattern exists elsewhere — if the same pattern is used in merged code, it may be intentional
- 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 |
More from sultanfarizbythen/skills
go-test-gen
Generate Go unit tests following project standards - table-driven tests with mockery mocks, explicit expectations with call counts, specific error objects, concrete structs. Use when writing unit tests for Go service layer or repository layer (NOT handler/API layer).
9sql-query-generator
Generate and execute SQL queries for databases using the Kalysta MCP server. Use when the user needs to query database information, analyze data patterns, explore table contents, generate reports, or investigate data. Supports any database accessible via Kalysta MCP.
9create-devops-task
Creates draft tasks on the Bythen Devops GitHub Project board (https://github.com/orgs/tanookiai/projects/2/views/1). Always assigns novahariyabythen. Use when asked to add tasks, to-dos, or action items to the devops board.
4update-scientia-ip
Update the Scientia WiFi IP whitelist in Jenkins. Captures the current public IP before VPN, connects OpenVPN, then triggers the Jenkins `change-ip-wifi-scientia` job with the captured IP. Use when your WiFi IP has changed and you need to regain Scientia access.
4go-pr-description
>
3be-jenkins-deploy
Deploy a backend (BE) branch to a non-production Jenkins job and notify when done. Use this skill whenever the user says "deploy to staging", "deploy to jenkins", "trigger jenkins build", "deploy branch", "push to jenkins", or any variation of deploying/releasing a backend service via Jenkins CI/CD. Also trigger when the user asks to redeploy or check a Jenkins deployment in progress. Do NOT use this skill if the user mentions "prod", "production", or "beta" — those environments require manual confirmation and are out of scope.
3