MiniMax-AI/mcode-stack / stacks/jiachen/skills/pr-review
pr-review
VerifiedReview a pull request or the current branch with the MCode Review rules (severity, evidence ladder, lens checklists, review principles) and the repository's own .mcode-review.json and .mcode-review.md. Works with GitHub pull requests and GitLab merge requests. Use when the MCode Review CI pipeline starts a review pass, or when a developer asks to review their PR or branch before asking a person to review it.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.3 KB |
| references/evidence-ladder.md | markdown | 675 B |
| references/lenses/behavior.md | markdown | 1.0 KB |
| references/lenses/contracts.md | markdown | 1.2 KB |
| references/lenses/cross-feature.md | markdown | 1.3 KB |
| references/lenses/duplication.md | markdown | 1.8 KB |
| references/lenses/general.md | markdown | 887 B |
| references/lenses/security.md | markdown | 887 B |
| references/repos/example.md | markdown | 1.4 KB |
| references/severity.md | markdown | 2.1 KB |
| references/stacks/go-backend.md | markdown | 4.8 KB |
| references/team-principles.md | markdown | 1.2 KB |
references/stacks/go-backend.md
View on GitHub# Stack: Go backend
Read this checklist together with your lens checklist when the PR changes Go code or `go.mod`. It lists failure patterns that fix PRs in Go services keep repairing: HTTP and RPC handlers, an ORM, Redis, message queues, a config center, and traffic lanes that route requests to separate environments.
1. Retries and unknown outcomes. A retry after an unknown outcome reuses the idempotency key of the first attempt; a new operation gets a new key. Ask what happens when the downstream call succeeded but the process died before recording it.
2. Concurrent requests with the same key. Both may read "not found" first; the one that loses must not return the winner's result as its own. Batch claims lock in one fixed order and only the rows they need.
3. `errgroup.WithContext` cancels every goroutine when one fails, including writes that record work already done downstream. Record finished side effects with a context the group cannot cancel.
4. Goroutines, streams and connections that never end: an SSE loop waiting on a channel nobody closes, per-request background work, request buffers kept by reused contexts. A goroutine that outlives its request must not use the request's context or its frozen RPC metadata.
5. Blocking work before the first byte of a stream: a synchronous RPC before the first SSE frame makes every stream wait up to that RPC's timeout.
6. Lanes and environments. Workers, consumers and schedulers start in every lane or environment unless gated, so they can take tasks from shared tables or topics that the router meant for another lane. A staging environment must not share a topic or queue with production. An RPC forwards or pins the lane header on purpose.
7. Config. A code default equals current production behavior. One bad field must not discard the whole config. A failed read keeps the last good value. A missing optional setting turns its feature off instead of stopping the process. An in-process cache of a user setting delays its change.
8. Identity. User ids come from the auth context, never from the body or query. A global user id, a per-product user id and a business account id are different ids; check which mapping call each one uses. An id the caller supplies is checked for ownership before use.
9. Authentication order. A new credential type must not capture requests that use another one: route a Bearer token to the new path only when its prefix or format says it belongs there, and keep other tokens on the existing path. Cookie flags decide what the web client can read.
10. Fields lost between layers. When a request or response gains a field, check every converter on the path: HTTP to RPC, RPC to storage, storage to response. `omitempty` drops an empty list a client relies on. Some HTTP frameworks (Hertz, for one) bind tags recursively, so a nested struct with the same `query` tag is overwritten. Generated protocol code that was not regenerated drops new fields.
11. Error mapping. Expected outcomes (busy, conflict, insufficient balance, upstream rate limit, a tool's own error) are business results, not RPC failures or HTTP 500, or they trip success-rate alerts. A new downstream error code is registered, or it collapses into an unknown error. One cause is not reported as another.
12. SQL. A new query has an index that matches its WHERE and ORDER BY: large production tables and a statement time limit turn a full scan into an outage. Updates and deletes carry the owner condition. New columns are `NOT NULL DEFAULT` and use the collation of the existing tables. DDL runs before the deploy that needs it, and the PR says who runs it.
13. Generated client and IDL upgrades. A `go.mod` bump of a generated module can rename fields or renumber enums. Check stored values and old clients, and whether the description links the IDL change.
14. Units, time and limits. Credits, internal billing units and prices are never mixed. Time zone offsets can be half hours; a day range states which ends are included. External APIs have batch limits, such as 1000 keys per batch delete in common object stores.
15. Deletion. Deleting a parent stops and deletes the children that keep running and billing. Records that history still needs are soft-deleted.
16. Timeouts. Every new RPC or HTTP call has a deliberate timeout. Know whether the code or the platform config sets it, and what the callee's worst case is.
17. Metrics and logs. Label values are bounded; user-defined model names and tool names are not. Logs on hot paths can fill node disks. Credentials are never logged, and third-party responses are truncated.
18. Credentials in source. Keys, access key pairs and tokens belong in config or the secret store, including temporary test keys.
19. Long-lived branches. A fix often needs a twin PR for another maintained branch. A workaround meant for one branch must not reach the other, and a back-merge must not drop hunks.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |