encore-go-service — Claude Code skill: services and setup
This skill structures Encore.go services, Go packages, systems, and typed calls between services. Use it when adding a service or applying an agreed layout.
npx skills add encoredev/skills --skill encore-go-service -a claude-code
npx skills add encoredev/skills --skill go-service -a claude-codeWhat encore-go-service does
The skill shows how to arrange an Encore.go application around service packages, database files, migrations, and system folders. It covers a single root service, several independent services, and larger layouts where related services sit under systems.
A call from one service to another uses a normal Go import and function call; Encore handles the RPC layer. Shared helpers belong in packages without //encore:api, while a package with that annotation becomes a service. If service boundaries are still undecided, the skill points to encore-architecture.
What it helps with
- create an Encore.go service with an API endpoint
- lay out a Go application by service packages
- group related services into systems
- keep shared helpers in internal packages
- call one service from another through a typed function
Example prompts for the agent
- Create an Encore.go user service with a
GetUserendpoint in theuserpackage. - Organize this application into
commerceandidentitysystems with separate services. - Add a typed call from the
orderservice touserusing Encore.go conventions.
How to install encore-go-service
1Skills CLI (Vercel)
npx skills add encoredev/skills --skill encore-go-service -a claude-codenpx skills add encoredev/skills --skill go-service -a claude-code2Manually: put the files in place
~/.claude/skills/go-service/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/go-service/
1Skills CLI (Vercel)
npx skills add encoredev/skills --skill go-service -a codex2Manually: put the files in place
.agents/skills/go-service/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add encoredev/skills --skill go-service -a cursor2Manually: put the files in place
.cursor/skills/go-service/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install encoredev/skills go-service2Manually: put the files in place
.github/skills/go-service/SKILL.md1Skills CLI (Vercel)
npx skills add encoredev/skills --skill go-service -a gemini-cli2Platform CLI
gemini skills install https://github.com/encoredev/skills --path encore/go-serviceManually: put the files in place
.devin/skills/go-service/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add encoredev/skills --skill go-service -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about encore-go-service
How do I install encore-go-service in Claude Code?
Run npx skills add encoredev/skills --skill encore-go-service -a claude-code, then run npx skills add encoredev/skills --skill go-service -a claude-code. After that, check ~/.claude/skills/go-service/SKILL.md.
What does encore-go-service do?
It guides Encore.go service creation, package and system layout, internal helper packages, and typed calls between services.
When does an Encore.go package become a service?
A package becomes a service when it contains at least one endpoint marked with //encore:api. Packages without that annotation are used for shared code.
Source text
SKILL.md · Apache-2.0
---
name: encore-go-service
description: Implement Encore.go services and lay out an application using service packages, internal subpackages, systems, and typed service calls. For service boundaries and architecture decisions, use `encore-architecture`.
when_to_use: >-
User wants to add or modify an Encore.go service or microservice, implement an already-chosen service layout, organize packages and directories, group services into system folders, or call another service. Trigger phrases: "add a Go service", "create a Go service", "add a microservice", "service package", "lay out these services", "Go package layout", "internal package", "call another service".
---
# Encore.go Service Structure
## Instructions
In Encore.go, **each package with an API endpoint is automatically a service**. No special configuration needed.
### Creating a Service
Simply create a package with at least one `//encore:api` endpoint:
```go
// user/user.go
package user
import "context"
type User struct {
ID string `json:"id"`
Email string `json:"email"`
Name string `json:"name"`
}
//encore:api public method=GET path=/users/:id
func GetUser(ctx context.Context, params *GetUserParams) (*User, error) {
// This makes "user" a service
}
```
### Minimal Service Structure
```
user/
├── user.go # API endpoints
├── db.go # Database (if needed)
└── migrations/ # SQL migrations
└── 1_create_users.up.sql
```
## Application Patterns
### Single Service
An application can define its APIs in one root service package:
```
my-app/
├── encore.app
├── go.mod
├── api.go # All endpoints
├── db.go # Database
└── migrations/
└── 1_initial.up.sql
```
### Multi-Service
Each service lives in its own package:
```
my-app/
├── encore.app
├── go.mod
├── user/
│ ├── user.go
│ ├── db.go
│ └── migrations/
├── order/
│ ├── order.go
│ ├── db.go
│ └── migrations/
└── notification/
└── notification.go
```
### Large Application (System-based)
Group related services into systems:
```
my-app/
├── encore.app
├── go.mod
├── commerce/
│ ├── order/
│ │ └── order.go
│ ├── cart/
│ │ └── cart.go
│ └── payment/
│ └── payment.go
├── identity/
│ ├── user/
│ │ └── user.go
│ └── auth/
│ └── auth.go
└── comms/
├── email/
│ └── email.go
└── push/
└── push.go
```
## Service-to-Service Calls
Just import and call the function directly - Encore handles the RPC:
```go
package order
import (
"context"
"encore.app/user" // Import the user service
)
//encore:api auth method=GET path=/orders/:id
func GetOrderWithUser(ctx context.Context, params *GetOrderParams) (*OrderWithUser, error) {
order, err := getOrder(ctx, params.ID)
if err != nil {
return nil, err
}
// This becomes an RPC call - Encore handles it
orderUser, err := user.GetUser(ctx, &user.GetUserParams{ID: order.UserID})
if err != nil {
return nil, err
}
return &OrderWithUser{Order: order, User: orderUser}, nil
}
```
## Internal Helpers (Non-Service Packages)
Create packages without `//encore:api` endpoints for shared code:
```
my-app/
├── user/
│ └── user.go # Service (has API)
├── order/
│ └── order.go # Service (has API)
└── internal/
├── util/
│ └── util.go # Not a service (no API)
└── validation/
└── validate.go
```
## Guidelines
- A package becomes a service when it has `//encore:api` endpoints
- Services cannot be nested within other services
- Cross-service calls look like regular function calls
- Each service can have its own database
- Package names should be lowercase, descriptive
- Don't create services just for code organization - use sub-packages instead
- Use `encore-architecture` when the service boundaries have not been decided
© encoredev · Apache-2.0 · encoredev/skills