Skip to content
encoredev avatar

Encore Go Api

Typed Encore Go endpoint definitions with path, query, header, and cookie params and error returns.

CCM score
69 of 100
skills.sh installs
630
GitHub stars
31
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers typed request and response structs, //encore:api options (method, path, public, private, auth, sensitive), and mapping of params from path, query, headers, and cookies
  • Includes status codes via the encore:"httpstatus" tag, redaction of sensitive fields, and errs codes such as NotFound, InvalidArgument, and PermissionDenied
  • Guides request params as a pointer to a struct and error as the final return value, with raw endpoints and webhooks deferred to encore-go-webhook
  • Designed for Go services that expose typed JSON REST handlers and need request validation and HTTP error mapping

Install

$ npx -y skills add encoredev/skills --skill encore-go-api -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Encore Go API Endpoints

Instructions

When creating API endpoints with Encore Go, follow these patterns:

1. Basic API Endpoint

Use the //encore:api annotation above your function:

package user

import "context"

type GetUserParams struct {
    ID string
}

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) {
    // Implementation
    return &User{ID: params.ID, Email: "user@example.com", Name: "John"}, nil
}

2. POST with Request Body

type CreateUserParams struct {
    Email string `json:"email"`
    Name  string `json:"name"`
}

//encore:api public method=POST path=/users
func CreateUser(ctx context.Context, params *CreateUserParams) (*User, error) {
    // Implementation
    return &User{ID: "new-id", Email: params.Email, Name: params.Name}, nil
}

API Annotation Options

Details

Repository
github.com/encoredev/skills
Categories
Go, Backend & APIs
First seen
Jun 3, 2026

Questions

What does the encore-go-api skill do?

encore-go-api teaches an agent to define typed API endpoints in Encore Go using the //encore:api annotation. It covers typed request and response structs, path, query, header and cookie parameters, and error returns.

How do I install the encore-go-api skill?

Run npx -y skills add encoredev/skills --skill encore-go-api -y in your project. After that, encore-go-api lets the agent write Encore Go endpoints with typed request and response structs.

Where does encore-go-api rank in the Go category on Claude Marketplaces?

encore-go-api ranks in the top 100 of the Go category on Claude Marketplaces. Its neighbors in that category include golang-code-style, golang-testing and golang-error-handling, but encore-go-api focuses on Encore endpoints specifically.

Should I use encore-go-api for webhooks?

No, encore-go-api is for typed endpoints, not raw endpoints. For raw endpoints and inbound webhooks, encore-go-api points you to the separate encore-go-webhook skill.

Can encore-go-api handle authentication and sensitive data?

Yes, encore-go-api covers the auth option in the //encore:api annotation and the sensitive option, which redacts request and response payloads from traces. It also shows how to return custom HTTP status codes and standard errs error codes such as NotFound.

More from encoredev/skills

All 16

Similar to Encore Go Api

More Go