Skip to content

chore: update Go skill conventions#2060

Open
tgmendes wants to merge 3 commits intomainfrom
opencode/playful-pixel
Open

chore: update Go skill conventions#2060
tgmendes wants to merge 3 commits intomainfrom
opencode/playful-pixel

Conversation

@tgmendes
Copy link
Copy Markdown
Contributor

@tgmendes tgmendes commented Apr 1, 2026

Summary

  • clarify Go service dependency injection rules, including avoiding repo.Queries on new services and keeping dependencies out of session manager state
  • add explicit conventions for auth context handling, third-party client wrappers, local-dev stubs, and avoiding shallow one-line wrappers
  • expand testing guidance to prefer t.Context() and testify/mock for third-party integrations

@tgmendes tgmendes requested a review from a team as a code owner April 1, 2026 10:36
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment Apr 1, 2026 11:20am

Request Review

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 1, 2026

⚠️ No Changeset found

Latest commit: bbe7f1c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 1 additional finding in Devin Review.

Open in Devin Review

- Store dependencies on service structs via constructor-based dependency injection. Do NOT hide dependencies in session manager state.
- Avoid shallow helpers that are just a one-line wrapper around another method, especially when they are only used once.
- When using a slog logger, always use the context-aware methods: `DebugContext`, `InfoContext`, `WarnContext`, `ErrorContext`.
- When logging errors make sure to always include them in the log payload using `slog.String("error", err)`. Example: `logger.ErrorContext(ctx, "failed to write to database", slog.String("error", err))`.
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Pre-existing incorrect attr.SlogError call signature in logging examples

Line 25 was correctly updated to attr.SlogError(err) (one argument), matching the actual function signature func SlogError(v error) slog.Attr at server/internal/attr/conventions.go:266. However, the pre-existing logging examples at .agents/skills/golang/SKILL.md:348 and .agents/skills/golang/SKILL.md:362 still show attr.SlogError("error", err) — passing two arguments to a one-argument function. This would be a compile error if an agent followed these examples. Since this PR specifically updated the instruction text on line 25 to the correct form, it would be a good opportunity to also fix the examples below to match.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@tgmendes tgmendes changed the title docs: tighten Go skill conventions chore: update Go skill conventions Apr 1, 2026

</bad-example>

<good-example>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this is a good example that contrasts with the bad example. The bad example above is setting up a service. This example is setting up a dependency of sorts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants