grpc
/grpc
Wspiera tworzenie usług gRPC: Protocol Buffers, definicje usług, strumieniowanie, interceptory i generowanie kodu dla Node.js, Go, Java i Python.
- Autor
- claude-dev-suite ↗
- Repozytorium
- claude-dev-suite ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 21.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 21.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wspiera tworzenie usług gRPC: Protocol Buffers, definicje usług, strumieniowanie, interceptory i generowanie kodu dla Node.js, Go, Java i Python.
Wyzwalacze z opisu
Oryginalny opis (EN)
gRPC service development. Protocol Buffers (protobuf), service definitions, streaming (unary, server, client, bidirectional), interceptors, and code generation for Node.js, Go, Java, and Python. USE WHEN: user mentions "gRPC", "protobuf", "Protocol Buffers", ".proto", "grpc-js", "tonic", "grpc-java", "service mesh RPC" DO NOT USE FOR: REST APIs - use `rest-api`; GraphQL - use `graphql`; WebSocket - use real-time skills
Jak działa
- Proto Definition
- Node.js (@grpc/grpc-js)
- Go (google.golang.org/grpc)
- Error Handling
- Anti-Patterns
- Production Checklist
Podgląd SKILL.md
---
name: grpc
description: |
gRPC service development. Protocol Buffers (protobuf), service definitions,
streaming (unary, server, client, bidirectional), interceptors, and
code generation for Node.js, Go, Java, and Python.
USE WHEN: user mentions "gRPC", "protobuf", "Protocol Buffers", ".proto",
"grpc-js", "tonic", "grpc-java", "service mesh RPC"
DO NOT USE FOR: REST APIs - use `rest-api`;
GraphQL - use `graphql`; WebSocket - use real-time skills
allowed-tools: Read, Grep, Glob, Write, Edit
---
# gRPC
## Proto Definition
```protobuf
// proto/product.proto
syntax = "proto3";
package product;
service ProductService {
rpc GetProduct(GetProductRequest) returns (Product);
rpc ListProducts(ListProductsRequest) returns (stream Product); // Server streaming
rpc UploadProducts(stream Product) returns (UploadResponse); // Client streaming
rpc SyncProducts(stream SyncRequest) returns (stream SyncResponse); // Bidirectional
}
message Product {
string id = 1;
string name = 2;
double price = 3;
repeated string tags = 4;
google.protobuf.Timestamp created_at = 5;
}
message GetProductRequest { string id = 1; }
message ListProductsRequest {
int32 page_size = 1;
string page_token = 2;
}
message UploadResponse { int32 count = 1; }
```
## Node.js (@grpc/grpc-js)
```typescript
import * as grpc from '@grpc/grpc-js';
import * as protoLoader from '@grpc/proto-loader';
const packageDef = protoLoader.loadSync('proto/product.proto');
const proto = grpc.loadPackageDefinition(packageDef).product as any;
// Server
const server = new grpc.Server();
server.addService(proto.ProductService.service, {
getProduct: (call: any, callback: any) => {
const product = db.findProduct(call.request.id);
callback(null, product);
},
listProducts: (call: any) => {
const products = db.listProducts(call.request);
for (const p of products) call.write(p);
call.end();
},
});
server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => {
console.log('gRPC server running on port 50051');
});
// Client
const client = new proto.ProductService('localhost:50051', grpc.credentials.createInsecure());
client.getProduct({ id: '123' }, (err: any, product: any) => {
console.log(product);
});
```
## Go (google.golang.org/grpc)
```go
// Server implementation
type productServer struct {
pb.UnimplementedProductServiceServer
}
func (s *productServer) GetProduct(ctx context.Context, req *pb.GetProductRequest) (*pb.Product, error) {
product, err := s.db.FindProduct(req.Id)
if err != nil {
return nil, status.Errorf(codes.NotFound, "product not found: %s", req.Id)
}
return product, nil
}
func main() {
lis, _ := net.Listen("tcp", ":50051")
s := grpc.NewServer(
grpc.UnaryInterceptor(loggingInterceptor),
)
pb.RegisterProductServiceServer(s, &productServer{})
s.Serve(lis)
}
```
## Error Handling
```typescript
// Use standard gRPC status codes
import { status } from '@grpc/grpc-js';
callback({
code: status.NOT_FOUND,
message: `Product ${id} not found`,
});
callback({
code: status.INVALID_ARGUMENT,
message: 'Product name is required',
});
```
| Code | Use When |
|------|----------|
| `NOT_FOUND` | Resource doesn't exist |
| `INVALID_ARGUMENT` | Bad request data |
| `PERMISSION_DENIED` | Insufficient permissions |
| `UNAUTHENTICATED` | Missing/invalid credentials |
| `UNAVAILABLE` | Service temporarily down (retryable) |
## Anti-Patterns
| Anti-Pattern | Fix |
|--------------|-----|
| Returning HTTP status codes | Use gRPC status codes |
| No deadline/timeout on calls | Always set `deadline` on client calls |
| Large messages (>4MB default) | Stream large data, or increase `maxReceiveMessageLength` |
| No interceptors for auth/logging | Use unary/stream interceptors |
| Proto files not versioned | Keep .proto in source control, use package versioning |
## Production Checklist
- [ ] TLS certificates configured
- [ ] Health check service (gRPC health checking protocol)
- [ ] Interceptors for auth, logging, metrics
- [ ] Deadlines set on all client calls
- [ ] Proto file versioning strategy
- [ ] Load balancing configured (client-side or L7)
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · claude-dev-suite/claude-dev-suite | 100 | MIT |
| TerminalSkills/skills | 100 | Apache-2.0 |
| managedcode/dotnet-skills | 100 | MIT |
| G1Joshi/Agent-Skills | 100 | MIT |
| arbazkhan971/godmode | 100 | MIT |
| dkbnull/hello-skill | 96 | MIT |
| chrishuffman5/domain-expert | 90 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 729c6ff1cf17 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100grpc-development
Podaje dobre praktyki budowy wydajnych usług z gRPC i Protocol Buffers: projekt usług RPC, schematy protobuf, API strumieniowe, interceptory i komunikacja między językami. - 90backend-grpc-patterns
Projektuje usługi gRPC: schematy protobuf, strumieniowanie, interceptory i obsługę błędów zgodną z konwencjami. - 100generating-grpc-services
Generuje definicje usług gRPC, stuby i implementacje z Protocol Buffers dla wydajnych usług gRPC. - 100generating-grpc-services
Generuje definicje usług gRPC, stuby i implementacje z Protocol Buffers dla wydajnych usług gRPC. - 95api-graphql-grpc
Projektuje schematy GraphQL, resolvery, wzorce query, mutation i subscription oraz definicje protobuf dla usług gRPC, w tym DataLoader i wybór między GraphQL, REST i gRPC. - 100grpc-expert
Wspiera pracę z gRPC, Protocol Buffers, komunikacją mikroserwisów i strumieniowaniem na poziomie eksperckim, w tym wzorce komunikacji i funkcje produkcyjne.