Files
yutu/AGENTS.md
T

1.0 KiB

Agent Guidelines

Commands

  • Build: go build ./... or bazel build //...
  • Test (All): go test ./... or bazel test //...
  • Test (Single): go test -v ./pkg/path -run TestName
  • Lint: go vet ./...
  • Update Bazel: bazel run //:gazelle (Run this after adding/removing files or imports)

Code Style

  • Formatting: Ensure code is formatted with go fmt.
  • Naming: Use camelCase for multi-word packages, directories, and filenames (e.g., channelBanner, i18nRegion).
  • Headers: Run addlicense -c "eat-pray-ai & OpenWaygate" -f LICENSE -s=only -ignore "**/*.yml" -ignore "**/*.yaml" -ignore "**/*.bazel" . to add headers.
  • Imports: Group standard library first, then third-party, then local imports.
  • Errors: explicit error handling if err != nil.
  • Commits: Follow gitmoji convention.

Structure

  • CLI Commands: Located in cmd/<resource>/.
  • Core Logic: Located in pkg/<resource>/.
  • Tests: Co-located with code in pkg/ as _test.go.