Create API layer components for a new entity. Includes usecase interactors (internal/usecase/), proto definitions (schema/proto/), gRPC handlers (internal/infrastructure/grpc/), and DI registration. Use when adding CRUD endpoints or Step 3 of CRUD workflow (after add-domain-entity).
Create complete API layer: usecase interactors, proto definitions, gRPC handlers, and DI registration.
make migrate.up)1. Usecase Input/Output --> internal/usecase/input/, output/
2. Interactor Interface --> internal/usecase/{actor}_{entity}.go
3. Interactor Impl --> internal/usecase/{actor}_{entity}_impl.go
4. Proto Definition --> schema/proto/rapid/{actor}_api/v1/
5. Generate Proto --> make generate.buf
6. Handler Marshaller --> handler/{actor}/marshaller/{entity}.go
7. Handler Methods --> handler/{actor}/{entity}.go
8. Update Handler Struct --> handler/{actor}/handler.go
9. Register in DI --> dependency/dependency.go
10. Generate & Test --> make generate.mock && make test
Location: internal/usecase/input/{actor}_{entity}.go
Create input structs for each operation (Create, Get, List, Update, Delete).
Each struct needs a Validate() method.
See: references/usecase-patterns.md
Location: internal/usecase/output/{actor}_{entity}.go
Create output struct only for List operations (returns slice + count).
See: references/usecase-patterns.md
Location: internal/usecase/{actor}_{entity}.go
Define interface with //go:generate directive for mock generation.
See: references/usecase-patterns.md
Location: internal/usecase/{actor}_{entity}_impl.go
Implement CRUD methods following transaction patterns:
See: references/usecase-patterns.md
Create two files:
schema/proto/rapid/{actor}_api/v1/model_{entity}.protoschema/proto/rapid/{actor}_api/v1/api_{entity}.protoThen add RPCs to: schema/proto/rapid/{actor}_api/v1/api.proto
See: references/proto-patterns.md
make generate.buf
Location: internal/infrastructure/grpc/internal/handler/{actor}/marshaller/{entity}.go
Convert between domain models and proto messages.
See: references/handler-patterns.md
Location: internal/infrastructure/grpc/internal/handler/{actor}/{entity}.go
Implement gRPC handler methods that delegate to interactors.
See: references/handler-patterns.md
Location: internal/infrastructure/grpc/internal/handler/{actor}/handler.go
Add new interactor field and constructor parameter.
See: references/handler-patterns.md
Location: internal/infrastructure/dependency/dependency.go
Dependency structInject() methodgrpc/run.go to pass interactor to handler constructorSee: references/handler-patterns.md
make generate.mock
make test
Validate() method//go:generateopenapiv2_schemamake generate.buf)make generate.mock)make test)| Error | Solution |
|-------|----------|
| undefined: pb.Example | Run make generate.buf |
| undefined: mock_usecase.MockAdminExampleInteractor | Run make generate.mock |
| Handler method not found | Check handler struct field name and interface registration |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer