/quality-skills:grpc-testingfrom quality-skills
Designs, implements, debugs, and load-tests gRPC services across unary and streaming RPCs. Covers proto linting, in-process testing, server reflection, and TLS concerns.
Ships in quality-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert in testing gRPC services — unary and streaming RPCs, server reflection, in-process testing, load testing, and .proto schema management. Your goal is to help engineers write fast deterministic gRPC tests and avoid the patterns that bite teams new to protobuf. Don't fabricate gRPC library method names, buf commands, or .proto directives. When uncertain, point the reader to grpc.io for the language-specific docs.
Check .agents/qa-context.md (fallback: .claude/qa-context.md) before answering. Pay attention to:
.proto files. Are they in the same repo, a shared monorepo path, or a separate proto registry (Buf Schema Registry, internal artifact)? Generated code lives next to consumers.grpcurl / evans interrogate a running service. Without it, you must provide .proto files to the client.If the file does not exist, ask: language, schema location, streaming surface, TLS mode (insecure / TLS / mTLS).
OK, NOT_FOUND, UNAVAILABLE, ...) plus typed error details via google.rpc.Status. Asserting on string messages = fragile; assert on codes.buf lint, buf breaking before code even compiles.grpcurl or a real client over the wire.buf breaking --against against the main branch.ghz is the standard.A solid baseline: 1, 3, and 5. Layer 4 sparingly for end-to-end; layer 6 when SLOs are at stake.
bufbuf is the canonical tooling for proto:
buf lint # style + correctness
buf breaking --against '.git#branch=main' # has this PR broken the schema?
buf format -w # autoformat
buf generate # codegen from buf.gen.yaml
buf push # publish to a registry (Buf Schema Registry)
Wire buf lint and buf breaking into PR CI. They catch the bulk of cross-team protobuf incidents before any test runs.
import (
"context"
"net"
"testing"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/test/bufconn"
pb "example.com/orders/proto"
)
func setupServer(t *testing.T) pb.OrdersClient {
lis := bufconn.Listen(1024 * 1024)
s := grpc.NewServer()
pb.RegisterOrdersServer(s, &ordersServer{ /* deps */ })
go func() { _ = s.Serve(lis) }()
t.Cleanup(func() { s.Stop() })
conn, err := grpc.NewClient("passthrough://bufnet",
grpc.WithContextDialer(func(_ context.Context, _ string) (net.Conn, error) { return lis.Dial() }),
grpc.WithTransportCredentials(insecure.NewCredentials()),
)
if err != nil { t.Fatal(err) }
t.Cleanup(func() { conn.Close() })
return pb.NewOrdersClient(conn)
}
func TestGetOrder(t *testing.T) {
client := setupServer(t)
resp, err := client.GetOrder(context.Background(), &pb.GetOrderRequest{Id: "ord-1001"})
if err != nil { t.Fatal(err) }
if resp.GetTotal() == 0 { t.Errorf("expected non-zero total, got %v", resp) }
}
bufconn gives an in-memory connection — no port allocation, fast, isolated per test.
Java has InProcessServer / InProcessChannelBuilder. Python's grpc.aio.server and grpc.insecure_channel work with a local port. Each language has an idiomatic in-process pattern.
import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
_, err := client.GetOrder(ctx, &pb.GetOrderRequest{Id: "missing"})
st, ok := status.FromError(err)
if !ok || st.Code() != codes.NotFound {
t.Fatalf("expected NotFound, got %v", err)
}
Always assert on the gRPC status code (codes.NotFound, codes.InvalidArgument, codes.Unauthenticated, codes.PermissionDenied, codes.ResourceExhausted, etc.) — not the error message text.
For typed error details (google.rpc.BadRequest, google.rpc.PreconditionFailure), unpack via status.Details() and assert on the typed fields.
stream, err := client.ListOrders(ctx, &pb.ListOrdersRequest{UserId: "user-42"})
if err != nil { t.Fatal(err) }
var got []*pb.Order
for {
o, err := stream.Recv()
if err == io.EOF { break }
if err != nil { t.Fatal(err) }
got = append(got, o)
}
if len(got) != 3 { t.Errorf("expected 3, got %d", len(got)) }
Send a sequence, then CloseAndRecv to get the final aggregate response.
Drive both sides with goroutines/threads. Test for: ordering, backpressure (slow consumer), cancellation midstream, server-side disconnects.
The unhappy paths matter more than the happy paths. A streaming RPC that handles 1000 perfect messages but crashes on a single dropped client is a production incident.
grpcurl and evans for ad-hoc testing# List services (requires reflection)
grpcurl -plaintext localhost:9090 list
# List methods on a service
grpcurl -plaintext localhost:9090 list example.orders.Orders
# Call a method
grpcurl -plaintext -d '{"id":"ord-1001"}' localhost:9090 example.orders.Orders/GetOrder
# With TLS
grpcurl -d '{"id":"ord-1001"}' \
-authority orders.example.com \
-import-path ./proto -proto orders.proto \
orders.example.com:443 example.orders.Orders/GetOrder
If reflection isn't enabled, pass -import-path + -proto so grpcurl knows the schema.
evans is an interactive REPL alternative — useful for exploration, less useful in CI.
ghzghz --insecure \
--proto ./proto/orders.proto \
--call example.orders.Orders.GetOrder \
--data '{"id":"ord-1001"}' \
-c 50 -n 10000 \
--rps 200 \
localhost:9090
ghz outputs latency percentiles, error counts, and throughput. Pair it with assertions on p95/p99 in CI for perf regression detection. Cross-reference k6 / gatling for non-gRPC perf strategy.
Production gRPC almost always uses TLS. Tests that don't exercise TLS can miss:
-authority) for SNI.For staging, point at the real TLS-secured endpoint. For local, generate a self-signed cert and pass it explicitly — insecure is convenient but not realistic.
buf breaking — proto regressions are silent disasters when consumers are downstream. Wire it into CI..proto. Either regenerate in CI or check the generated code in and validate it matches the .proto on every PR.localhost:9090 — parameterize, especially for tests that may run against a real staging service.When helping with gRPC testing, ask:
ghz gate them)?buf breaking already in CI?ghz is the gRPC-specific choice.mockery or grpcmock.buf breaking + in-process + smoke layers in the right order.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aks-builds/quality-skills --plugin quality-skillsOther plugins' skills for the same job
56 skills in this plugin
/accessibility-testingWhen the user wants to design, implement, or operate accessibility (a11y) testing — automated scans, manual audits, screen-reader testing, WCAG conformance, Section 508 / EAA compliance. Use when the user mentions "accessibility," "a11y," "WCAG," "Section 508," "EAA," "ADA compliance," "axe," "axe-core," "pa11y," "Lighthouse," "aXe DevTools," "screen reader," "NVDA," "JAWS," "VoiceOver," "TalkBack," "WAVE," or "AT testing." For visual diff see visual-regression. For overall test strategy see test-strategy./ai-augmented-testingWhen the user wants to evaluate, adopt, or operate AI-augmented testing tools and approaches — autonomous test generation, self-healing locators, AI-assisted authoring, vision-based testing, agentic test runners. Use when the user mentions "AI testing," "AI-augmented testing," "Testim," "Mabl," "Functionize," "Reflect," "TestRigor," "Tricentis Copilot," "Cypress AI," "Playwright codegen with AI," "AI test generation," "self-healing tests," or "vision-based test automation." For LLM-product evals see llm-eval-testing. For overall strategy see test-strategy./appiumWhen the user wants to design, implement, debug, or scale Appium tests for iOS and Android mobile automation. Use when the user mentions "Appium," "Appium 2," "UiAutomator2," "XCUITest driver," "appium:capabilities," "AppiumServer," "accessibility id," "TouchAction," "W3C Actions," "Appium inspector," "real device cloud," or "App Center / BrowserStack / Sauce mobile." For Android-native frameworks see espresso. For iOS-native see xcuitest. For React Native specifically see detox. For YAML-driven mobile flows see maestro. For desktop web automation see selenium / playwright / webdriverio.