/SKILL.md
Comprehensive knowledge base for go-kratos microservices framework. **Use this skill when:** - Building REST/gRPC APIs with kratos (Service → Biz → Data layered architecture) - Creating microservices with DDD and Clean Architecture patterns - Implementing dependency injection with Wire - Configuring service discovery, load balancing, and resilience patterns - Troubleshooting kratos issues or understanding framework conventions - Generating production-ready microservices code with Protobuf **Features:** - Complete pattern guides with ✅ correct and ❌ incorrect examples - DDD/Clean Architecture enforcement - Production best practices - Common pitfall solutions
npx skillsauth add lwx-cloud/kratos-skills kratos-skillsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides comprehensive go-kratos microservices framework knowledge, optimized for AI agents helping developers build production-ready services.
Invoke this skill when working with go-kratos:
Load specific guides as needed rather than reading everything at once:
Link: Official Kratos Documentation Contains: Installation, project creation, basic commands, hello-world examples
| File | When to Load | |------|-------------| | references/api-patterns.md | Defining Protobuf APIs, generating HTTP/gRPC code | | references/transport-patterns.md | HTTP/gRPC server/client configuration | | references/encoding-patterns.md | Custom serialization, content negotiation | | references/openapi-guide.md | OpenAPI/Swagger documentation generation |
| File | When to Load | |------|-------------| | references/architecture-patterns.md | DDD layers, repository pattern, Wire DI | | references/error-patterns.md | Error definition, assertions, proto errors | | references/middleware-patterns.md | Custom middleware, request filtering |
| File | When to Load | |------|-------------| | references/config-patterns.md | Configuration loading, hot reload, config centers | | references/registry-patterns.md | Service discovery (etcd, consul, nacos, k8s) | | references/selector-patterns.md | Load balancing (P2C, WRR, random) |
| File | When to Load | |------|-------------| | references/circuit-breaker-patterns.md | Fault tolerance, SRE circuit breaker | | references/ratelimit-patterns.md | Token bucket, BBR rate limiting | | references/recovery-patterns.md | Panic recovery, stack trace logging |
| File | When to Load | |------|-------------| | references/logging-patterns.md | Structured logging, Zap/Logrus adapters | | references/metrics-patterns.md | Prometheus metrics collection | | references/tracing-patterns.md | OpenTelemetry, Jaeger/Zipkin tracing | | references/metadata-patterns.md | Context propagation, trace IDs |
| File | When to Load | |------|-------------| | references/auth-patterns.md | JWT authentication, claims, token generation | | references/validate-patterns.md | Proto field validation, protoc-gen-validate |
| File | When to Load | |------|-------------| | references/ent-patterns.md | Ent ORM integration, schema design | | references/cli-guide.md | kratos CLI, code generation commands |
| File | When to Load | |------|-------------| | best-practices/overview.md | Production deployment, code review checklist | | troubleshooting/common-issues.md | Debugging errors, protoc/wire issues | | getting-started/claude-code-guide.md | Claude Code integration, advanced features |
kratos new <project-name>.proto with google.api.http annotationskratos proto client api/demo/v1/demo.protokratos proto server api/demo/v1/demo.proto -t internal/serviceinternal/biz/, data access in internal/data/cmd/server/wire.go with provider setsgo generate ./... && kratos runDetails: references/api-patterns.md
internal/biz/ (biz layer)internal/data/ (data layer)internal/biz/ (biz layer)internal/service/ (service layer)data.ProviderSet, biz.ProviderSet, service.ProviderSetcmd/server/wire.goDetails: references/architecture-patterns.md
http.Middleware(
recovery.Recovery(), // 1. Catch panics first
validate.Validator(), // 2. Validate requests
jwt.Server(keyFunc), // 3. Authentication
ratelimit.Server(limiter), // 4. Rate limiting
logging.Server(logger), // 5. Logging
)
Details: references/middleware-patterns.md
// Server-side
reg := etcd.New(client)
app := kratos.New(kratos.Registrar(reg))
// Client-side
dis := etcd.New(client)
conn, _ := grpc.DialInsecure(
context.Background(),
grpc.WithEndpoint("discovery:///service-name"),
grpc.WithDiscovery(dis),
)
Details: references/registry-patterns.md
.proto filesctx context.Context through all layerserr != nil.pb.go files| Project | Purpose | |---------|---------| | kratos | Framework core, CLI tools | | kratos-layout | Official project template | | contrib | Plugins for config, registry, log, metrics | | aegis | Availability algorithms | | gateway | API Gateway | | examples | Example code |
Quick invocation: Use /kratos-skills or ask "How do I [task] with kratos?"
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.