Add Connect RPC Go benchmark with architecture agent#4
Merged
Conversation
Implements all ContentService RPCs using connectrpc.com/connect with in-memory storage, h2c for gRPC compatibility, and a multi-stage Dockerfile with buf-based proto code generation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Create .claude/agents/connect-rpc-go.md with layered architecture guide (APP/API/DOMAIN/OUTBOX) for scaffold-implementation delegation - Add agent delegation step to scaffold-implementation command - Upgrade buf.gen.yaml to v2 format with protoc_builtin/remote plugins - Update Dockerfile to use buf v2 config Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new Go + Connect RPC benchmark target for the content-api project, plus Claude scaffolding guidance to generate future implementations with an architecture-specific agent and buf v2 generation templates.
Changes:
- Scaffold
projects/content-api/connect-rpcwith an in-memory Connect RPC service, Docker build, and compose setup. - Register the new benchmark target (
content-api/connect-rpc) inbenchmark.config.json. - Add agent delegation to the scaffold command and introduce a
connect-rpc-goarchitecture agent prompt.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
projects/content-api/connect-rpc/internal/service/content.go |
In-memory CRUD implementation for the protobuf-defined ContentService. |
projects/content-api/connect-rpc/cmd/server/main.go |
Starts health HTTP server + h2c gRPC/Connect server. |
projects/content-api/connect-rpc/docker-compose.yml |
Defines the benchmark service container and healthcheck. |
projects/content-api/connect-rpc/Dockerfile |
Multi-stage image: buf codegen → build → minimal runtime. |
projects/content-api/connect-rpc/buf.gen.yaml |
Buf v2 generation template for Go + Connect codegen. |
projects/content-api/connect-rpc/go.mod |
New Go module for the benchmark implementation with pinned deps. |
projects/content-api/connect-rpc/go.sum |
Checksums for the Go module dependencies. |
benchmark.config.json |
Registers the new content-api/connect-rpc benchmark target with k6 config. |
.claude/commands/scaffold-implementation.md |
Adds agent delegation to support architecture-specific scaffolds. |
.claude/agents/connect-rpc-go.md |
New agent prompt defining a layered Connect RPC Go architecture. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Cover the full loop: define APIs, scaffold implementations with Claude Code, run benchmarks, and compare results. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add /define-api Claude Code command for interactive API project creation - Split proto into _service, _model, _refs files under package-matching paths - Add buf validate annotations on all request fields - Use google.protobuf.Timestamp instead of string for timestamps - Use google.protobuf.FieldMask for partial updates - Use page_size/page_token cursor pagination instead of limit/offset - Remove health endpoints from all API specs (implementation convention) - Unify gRPC and health on single port 8080 across k6 scripts - Update PROTO_PATH to PROTO_DIR for multi-file proto loading Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Define Content entity with title, body, status, and tags fields. Proto split into model/refs/service files with buf validate, field masks, cursor pagination, and google.protobuf.Timestamp. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Scaffold layered architecture: cmd (app wiring), internal/api (Connect handlers), internal/domain (business logic with sqlc), internal/outbox (River queue events), and pkg (reusable config, cache, connectapp, connectutil, migrate, outbox). Includes Dockerfile (multi-stage with buf + sqlc codegen), docker-compose (postgres, opensearch, dashboards, codegen profile), and benchmark target. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update sqlc override, domain service imports, setup_domains import, and pinned versions table in the connect-rpc-go architecture agent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace import paths, sqlc override, and uuid.Parse calls with uuid.FromString across all domain, API, and wiring layers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures dependencies are resolved from scaffolded imports before the checklist is considered complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Makefile provides codegen (docker-based proto + sqlc generation) and tidy (codegen + go mod tidy) targets. Agent updated to generate a Makefile and run make tidy as post-generation step. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- buf.gen.yaml: add managed mode with go_package_prefix to rewrite proto imports, disable for protovalidate dep - mapper.go: use pgtype.Text/Int4 for sqlc nullable params (not pointers) - interceptors.go: validate.NewInterceptor returns 1 value, not 2 - main.go: remove unused connectapp import - Agent: document managed mode, pgtype nullable params, unused import convention, fix code examples Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Makefile targets: codegen, tidy, vet, build, test, start, stop, clean. Agent updated with post-generation devloop (vet → build → start → stop) and common error troubleshooting guide. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix 18 inconsistencies between agent template and implementation: event struct (ID+Data), List signature (cursor-based), response wrapping, import paths (<module>/ prefix), error handling (log.Fatal), migrations embed (separate package), op_get error discrimination, DeleteContent :execrows, sqlc timestamptz override, event file naming (by concern), interceptors unused import. Update implementation versions to match agent pinned versions (Go 1.25.6, buf v1.66.0, sqlc v1.30.0, OpenSearch 3.5.0). Add platform-backend architecture document for cross-stack reuse. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Relocate from projects/content-api/_architecture/ to _architecture/ (next to platform-backend.png). Rewrite to describe layers generically by what they expose and consume rather than using Go-specific examples. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Structured review checklist covering: directory structure, layer dependencies, interface-first pattern, file-per-concern convention, error handling, transactional outbox, read-through cache, import correctness, codegen config, proto compliance, server/interceptors, infrastructure, and migrations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Runs Docker build (codegen + compile + runtime) on pushes and PRs that touch the implementation or shared protobuf specs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use k6 built-in crypto.randomUUID() instead of importing randomString from jslib.k6.io. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.claude/agents/connect-rpc-go.md) that defines a layered architecture (APP/API/DOMAIN/OUTBOX) with sqlc, River queue, goose migrations, zerolog, godotenv config, and buf validateTest plan
npm run benchmark -- listand confirmcontent-api/connect-rpctarget appearsnpm run benchmark -- build content-api/connect-rpcand confirm Docker build succeeds/scaffold-implementation, pick protobuf + connect-rpc + go, and confirm it delegates to the agent prompt🤖 Generated with Claude Code