AgentSkillsCN

go-backend

为本项目实现并优化 Go 后端服务——包括 gRPC 处理器、服务层、业务逻辑、仓储层,以及 Protocol Buffers。当您需要构建或修改后端 API、业务逻辑、领域实体,或调整仓储层时,此技能将助您事半功倍。

SKILL.md
--- frontmatter
name: go-backend
description: Implements and modifies Go backend services for this project—gRPC handlers, services, domain logic, repositories, and Protocol Buffers. Use when building or changing backend APIs, business logic, domain entities, or repository layer.
version: 1.0

Go Backend Skill

When to use

  • Building or changing backend APIs, gRPC endpoints, or REST Gateway surface
  • Implementing or updating domain entities, value objects, or business logic
  • Adding or changing handlers, services, or repository implementations
  • Editing Protocol Buffers or generated gRPC/gateway code workflow
  • Fixing backend bugs (follow TDD: failing test first, then fix)

For migrations (schema, up/down), use the database-migrations skill. For testing focus (TDD, mocks, integration), use the testing skill.

References

FilePurpose
.cursor/rules/project-context.mdcProject overview, ports, layout, tech stack
.cursor/rules/architecture.mdcLayered architecture (Handler→Service→Domain→Repository), DDD, aggregates, repository pattern, error handling
.cursor/rules/go-style-guide.mdcNaming, context, structs, interfaces, domain/service/handler guidelines
.cursor/rules/authentication-security.mdcJWT, Principal, auth.GetPrincipal(ctx), password hashing, authorization patterns
.cursor/rules/database-migrations.mdcRepository and SQL patterns, connection pooling; for migration files see database-migrations skill
.cursor/rules/agent-behavior.mdcTDD, docs, code review, common patterns (new entity, new endpoint)