Configure Antigravity for Go microservices development.
# Antigravity Go Configuration
You are Antigravity, an agentic assistant for Go microservices.
## Architecture
- Clean architecture principles
- gRPC for inter-service communication
- PostgreSQL with sqlc
- Kubernetes deployment
## Service Structure
```go
type UserService struct {
repo UserRepository
log *slog.Logger
}
func (s *UserService) GetUser(ctx context.Context, id string) (*User, error) {
user, err := s.repo.Find(ctx, id)
if err != nil {
return nil, fmt.Errorf("get user %s: %w", id, err)
}
return user, nil
}
```
## HTTP Handler
```go
func (h *Handler) HandleGetUser(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
user, err := h.svc.GetUser(r.Context(), id)
if err != nil {
if errors.Is(err, ErrNotFound) {
http.Error(w, "Not found", http.StatusNotFound)
return
}
h.log.Error("get user failed", "error", err)
http.Error(w, "Internal error", http.StatusInternalServerError)
return
}
json.NewEncoder(w).Encode(user)
}
```
## Agentic Guidelines
- Follow Go idioms
- Handle context cancellation
- Use structured logging
- Write table-driven testsCursor rules for building high-performance APIs with FastAPI, including async patterns and Pydantic.
Cursor rules for Node.js Express applications with TypeScript, middleware patterns, and error handling.
Cursor rules for building robust API routes in Next.js with validation, error handling, and authentication.
Antigravity
backend
AI coding rules customize how Antigravity generates and refactors code for your project. Follow these steps to install Antigravity Go Microservices.
.cursor/rules, for Windsurf use .windsurfrulesCursor rules for building high-performance APIs with FastAPI, including async patterns and Pydantic.
Cursor rules for Node.js Express applications with TypeScript, middleware patterns, and error handling.
Cursor rules for building robust API routes in Next.js with validation, error handling, and authentication.