go-kratos

Bootstrap Kratos-based Go microservices with project structure, proto setup, and DI wiring.

6|1|Updated Dec 25, 2025
One-click install
npx skills add https://github.com/czyt/tinyskills --skill go-kratos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-kratos
Source: https://github.com/czyt/tinyskills/tree/main/skills/go-kratos
Command: npx skills add https://github.com/czyt/tinyskills --skill go-kratos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Kratos-based Go microservice development often requires consistent architecture, DI wiring, and proto + config setup. This skill provides a coherent, end-to-end blueprint and actionable patterns to accelerate building scalable Kratos services.

Core Features & Use Cases

  • End-to-end scaffolding for Kratos projects including Service, Biz, and Data layers with DI wiring (fx or wire).
  • Proto design guidance, buf-based validation, and code-generation patterns to streamline API contracts.
  • Configuration, startup hooks, and module registration patterns to ensure robust service initialization and lifecycle management.
  • Guidance for HTTP/gRPC integration, middleware composition, and secure patterns across typical Kratos workloads.
  • Real-world use cases: new microservice bootstrap, adding middleware, integrating DI, and configuring startup flows in Kratos.

Quick Start

Describe your Kratos project and I will guide you through scaffolding the project structure, proto definitions, and DI wiring.

Frequently Asked Questions about go-kratos

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I scaffold a new Go microservice project with Kratos layer structure?

To scaffold a Kratos microservice, structure your project into Service, Biz, and Data layers. This blueprint guides you through setting up the directory layout, wiring dependency injection, and configuring proto definitions for scalable Go services.

How does dependency injection work across Kratos service, biz, and data layers?

Dependency injection in Kratos wires the Service, Biz, and Data layers together to decouple business logic from data access. You can use tools like wire or fx to generate and manage the injection graph, ensuring robust service initialization and lifecycle management.

What is the best way to define proto files and generate API contracts in a Kratos project?

The best way to define API contracts in Kratos is using protobuf for proto design combined with buf for validation and code generation. This approach streamlines HTTP and gRPC integration by generating consistent server and client stubs directly from your API definitions.

Can I integrate custom middleware and configure startup hooks in Kratos?

Yes, you can integrate custom middleware and configure startup hooks in Kratos. The framework supports middleware composition for HTTP/gRPC services and provides lifecycle management patterns to securely register modules and execute startup flows across the architecture layers.

Do I need prior Go microservices experience to bootstrap a Kratos project?

You need a foundational understanding of Go and microservice architecture to bootstrap a Kratos project. The guidance covers end-to-end scaffolding, but familiarity with protobuf, dependency injection concepts, and layered architecture patterns is necessary to effectively apply the provided patterns.