Skip to main content
skill CX Codex

encore-service — Claude Code skill: what it does, how to install

Sets up Encore.ts service structure, folder layouts, and cross-service calls. Useful when adding microservices or organizing systems folders.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add encoredev/skills --skill encore-service -a claude-code
npx skills add encoredev/skills --skill service -a claude-code
Open on GitHub

What encore-service does

This skill guides coding assistants on building backend services with Encore.ts. It enforces the required convention where every service requires an encore.service.ts file initialized with new Service(). It covers single-service setups, multi-service directories, and grouping larger applications into top-level systems such as commerce or identity.

Calling another service directly via relative file imports will break the Encore service boundary. All cross-service communication must import from ~encore/clients. Services cannot be nested inside one another. If service boundaries are still unclear, use encore-architecture before laying out directories.

What it helps with

  • Initialize a new Encore.ts microservice with encore.service.ts
  • Group related services into system directories for large codebases
  • Configure cross-service API calls using ~encore/clients
  • Separate endpoints and database logic into api.ts and db.ts

Example prompts for the agent

  • Create an order service with encore.service.ts and a database migration
  • Group the payment and cart services inside a commerce system directory
  • Call the user service from order/api.ts using ~encore/clients

How to install encore-service

1Skills CLI (Vercel)

npx skills add encoredev/skills --skill encore-service -a claude-code
npx skills add encoredev/skills --skill service -a claude-code

2Manually: put the files in place

~/.claude/skills/service/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/service/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about encore-service

How do I install encore-service in Claude Code?

Run npx skills add encoredev/skills --skill encore-service -a claude-code. You can also save the file directly to ~/.claude/skills/service/SKILL.md.

What does the encore-service skill do?

It teaches coding agents layout conventions for Encore.ts backends. It defines how to structure single-service and multi-service apps, organize system folders, and invoke other services.

Can Encore services be nested inside each other?

No, nested services are not allowed in Encore.ts. Use regular folders for internal code organization and keep each service at its own directory level.

Source text

SKILL.md · Apache-2.0
---
name: encore-service
description: Implement Encore.ts services and lay out an application using `encore.service.ts`, service directories, systems, and `~encore/clients`. For service boundaries and architecture decisions, use `encore-architecture`.
when_to_use: >-
  User wants to add or modify an Encore.ts service or microservice, implement an already-chosen service layout, organize service files and directories, group services into system folders, or call another service. Trigger phrases: "add a service", "create a service", "add a microservice", "encore.service.ts", "lay out these services", "service directory", "systems folder", "~encore/clients".
---

# Encore Service Structure

## Instructions

### Creating a Service

Every Encore service needs an `encore.service.ts` file:

```typescript
// encore.service.ts
import { Service } from "encore.dev/service";

export default new Service("my-service");
```

### Minimal Service Structure

```
my-service/
├── encore.service.ts    # Service definition (required)
├── api.ts               # API endpoints
└── db.ts                # Database (if needed)
```

## Application Patterns

### Single Service

A service can be defined at the application root:

```
my-app/
├── package.json
├── encore.app
├── encore.service.ts
├── api.ts
├── db.ts
└── migrations/
    └── 001_initial.up.sql
```

### Multi-Service

Each service lives in its own directory:

```
my-app/
├── encore.app
├── package.json
├── user/
│   ├── encore.service.ts
│   ├── api.ts
│   └── db.ts
├── order/
│   ├── encore.service.ts
│   ├── api.ts
│   └── db.ts
└── notification/
    ├── encore.service.ts
    └── api.ts
```

### Large Application (System-based)

Group related services into systems:

```
my-app/
├── encore.app
├── commerce/
│   ├── order/
│   │   └── encore.service.ts
│   ├── cart/
│   │   └── encore.service.ts
│   └── payment/
│       └── encore.service.ts
├── identity/
│   ├── user/
│   │   └── encore.service.ts
│   └── auth/
│       └── encore.service.ts
└── comms/
    ├── email/
    │   └── encore.service.ts
    └── push/
        └── encore.service.ts
```

## Service-to-Service Calls

Import other services from `~encore/clients`:

```typescript
import { user } from "~encore/clients";

export const getOrderWithUser = api(
  { method: "GET", path: "/orders/:id", expose: true },
  async ({ id }): Promise<OrderWithUser> => {
    const order = await getOrder(id);
    const orderUser = await user.get({ id: order.userId });
    return { ...order, user: orderUser };
  }
);
```

## Guidelines

- Services cannot be nested within other services
- Use `~encore/clients` for cross-service calls (never direct imports)
- Each service can have its own database
- Service names should be lowercase, descriptive
- Don't create services just for code organization - use folders instead
- Use `encore-architecture` when the service boundaries have not been decided

© encoredev · Apache-2.0 · encoredev/skills

Similar skills

All skills for Backend and APIs →

From the same set25

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor