К основному содержанию
скилл CX Codex

encore-architecture — скилл для Claude Code

Скилл encore-architecture помогает спроектировать или разделить сервисы в приложениях на Encore.go и Encore.ts. Подходит для выбора границ сервисов, моделей данных и Pub/Sub.

Apache-2.0 167 установок ★ 30 обновлён 2026-10-23

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add encoredev/skills --skill encore-architecture -a claude-code
Открыть на GitHub

Что делает encore-architecture

Скилл формулирует правила логической архитектуры бэкенда до написания кода: определяет границы сервисов, разделяет ответственность за базы данных и помогает выбрать между синхронными API и очередями Pub/Sub. В его основе заложен принцип Encore, где сервис выступает границей кода и API, а не жёстким процессом развёртывания. Это позволяет запускать модули в одном процессе или разносить их по разным инстансам без правки самого приложения.

Инструкции скилла советуют начинать проект с одного сервиса и выносить функциональность отдельно только при наличии изолированных бизнес-задач. Он следит, чтобы архитектура не превращалась в распределённый монолит: предостерегает от технических слоёв вроде отдельных сервисов доступа к БД, напоминает о стоимости сетевых вызовов и помогает настроить разграничение публичных и приватных интерфейсов.

Вложенные сервисы в Encore запрещены, поэтому для группировки крупных проектов скилл ориентирует на использование каталогов систем. Для сохранения транзакционной целостности при отправке событий в Encore.go он предлагает опираться на встроенный паттерн outbox, а для TypeScript требует явной проработки консистентности.

Какие задачи решает

  • определить границы сервисов и зоны владения базой данных
  • разбить монолитное приложение Encore на независимые модули
  • выбрать между вызовом синхронного API и асинхронным Pub/Sub
  • разграничить публичные и приватные интерфейсы бэкенда

Примеры запросов агенту

  • Помоги спроектировать архитектуру приложения на Encore.ts для биллинга и заказов
  • Стоит ли делить этот сервис на два или лучше оставить монолит?
  • Как правильно распределить доступ к базе данных между сервисами в Encore?

Как установить encore-architecture

1Через Skills CLI (Vercel)

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

2Вручную: положить файлы

~/.claude/skills/architecture/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/architecture/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы об encore-architecture

Как установить encore-architecture в Claude Code?

Выполните в терминале команду npx skills add encoredev/skills --skill encore-architecture -a claude-code.

Что делает скилл encore-architecture?

Он задаёт ассистенту правила проектирования сервисов, баз данных и межсервисного взаимодействия в проектах на Encore.go и Encore.ts.

Обязательно ли выделять отдельную базу данных под каждый сервис?

Нет, Encore поддерживает общий доступ к базе через SQLDatabase.named в TypeScript или sqldb.Named в Go, если это снижает сложность интерфейсов.

Исходный текст

SKILL.md · Apache-2.0
---
name: encore-architecture
description: Design or revise the service architecture of an Encore.go or Encore.ts application. Covers service boundaries, data ownership, synchronous calls versus Pub/Sub, process allocation, public and private interfaces, and evolving a monolith.
when_to_use: >-
  User is deciding how many Encore services to create, where service boundaries belong, whether to split or merge services, which service owns data, or whether services should communicate through APIs or Pub/Sub. Also use for architecture reviews and plans to break up a monolith. Trigger phrases: "design the architecture", "service boundaries", "one service or several", "monolith vs microservices", "split this service", "who owns this database", "API or Pub/Sub", "distributed monolith", "chatty services".
---

# Encore application architecture

Design the logical application before choosing directories and declarations. Apply the same architectural reasoning to Encore.ts and Encore.go; use `encore-service` or `encore-go-service` for language-specific implementation.

## Read the application

Inspect the existing code and the Encore application model when available. Identify:

- User and system operations
- APIs, cron jobs, and Pub/Sub handlers
- Data models and the code that changes them
- Infrastructure resources and the services that use them
- Existing synchronous calls and event flows
- Failure, scaling, deployment, and security requirements

Preserve established application concepts unless the requested change requires redefining them.

## Separate services from processes

Treat an Encore service as a code and API boundary, not a fixed deployment unit. The Encore platform can run all services in one process or place each service in a separate process, configured per environment without code changes.

Use service boundaries to express application responsibilities. Use process allocation to change isolation and scaling without redesigning those responsibilities.

Keep the backend in one Encore application where practical so the application model spans its services, resources, IAM, tracing, and Flow diagram.

## Choose service boundaries

Start a new application with one service unless a stable boundary is already known. Organize code inside it with modules, directories, or Go subpackages.

Consider a separate service for a cohesive business capability with its own operations and data. Failure isolation, independent scaling or deployment, a smaller security interface, or an existing external-system seam can strengthen the case.

Account for the cost of the split: network failure, cross-service coordination, distributed consistency, and an interface that both sides must maintain. Keep behavior together when most changes affect both sides or neither side can complete useful work independently.

Avoid services that represent technical layers such as handlers, business logic, or database access. Expose capability operations such as `ReserveInventory`, not generic access to another service's tables.

Treat repeated sequential calls across one boundary and long chains of forwarding services as evidence that the proposed services may be too narrow.

## Assign data responsibility

Assign one service responsibility for each data model, its business rules, and its schema changes. Prefer calls or events when another service needs the owning service to enforce those rules.

Encore supports shared database access through `SQLDatabase.named` in TypeScript and `sqldb.Named` in Go. Use it deliberately for reporting, incremental migrations, or cases where another service interface would add more complexity than it removes. Define migration ownership and write access before sharing a database.

Do not impose one database per service as an Encore requirement. Evaluate the coupling created by shared schema access against the coupling created by another service interface.

## Choose communication

Use a typed service API when the caller needs a result before continuing, the operation must report success or failure, or one service owns the requested capability.

Use Pub/Sub when the caller need not wait, several consumers react independently, or consumer retries should not repeat the originating request. Account for eventual consistency and make handlers idempotent where duplicate delivery would affect correctness.

Keep immediate request/response workflows synchronous. Keep event consumers independent rather than recreating a synchronous call chain through ordered events.

When a database change and event publication must remain consistent, design for failure between them. Encore.go provides a transactional Pub/Sub outbox; other cases require an application-specific consistency mechanism.

## Define interfaces and authorization

Classify operations as public, authenticated, or private. Keep internal capability operations private unless an external client needs them.

Place authentication and cross-origin policy at the gateway. Keep authorization decisions about a specific capability or record with the service that owns it.

## Organize and evolve

Encore services cannot be nested. Group large sets of related services in system directories; systems organize source code and are not Encore resources or deployment units.

When splitting a service, identify the operations and data moving together, add the new service, replace direct calls with APIs or events, and define data ownership during the transition. Inspect the resulting model in Encore Flow and test calls that now cross the service boundary.

When recommending an architecture, name the proposed services, their responsibilities, owned resources, and communication paths. Explain the concrete reason for each service split and note important consistency or failure tradeoffs. Prefer the smallest architecture that satisfies the stated requirements.

See [App Structure](https://encore.dev/docs/app-structure) for the full guide and language-specific examples.

© encoredev · Apache-2.0 · encoredev/skills

Похожие скиллы

Все скиллы по теме «Бэкенд и API» →
architecture-modernizer davila7 Субагент architecture-modernizer для Claude Code проектирует разбиение монолита, микросервисы и событийные потоки. Вызывайте его для анализа границ модулей и планирования модернизации архитектуры. CX Codex 1 768установок architecture-designer https://github.com/Jeffallan Скилл architecture-designer проектирует архитектуру распределённых систем, составляет диаграммы Mermaid и оформляет решения через ADR. Помогает сопоставить требования с шаблонами вроде микросервисов или монолита. CX Codex +1 8 500установок microservices-architecture aj-geddes Скилл microservices-architecture помогает проектировать микросервисную архитектуру, определять границы контекстов и настраивать взаимодействие сервисов. Пригодится при распиле монолита и создании распределённых систем. CX Codex +1 530установок architecture-patterns miles990 Скилл architecture-patterns подсказывает архитектурные шаблоны для бэкенда: от монолита и микросервисов до Clean Architecture и DDD. CX Codex +1 282установок Architecture Intelligence Platform michaelegner MCP-сервер Architecture Intelligence Platform сопоставляет описания API с трассировкой OpenTelemetry и передаёт агенту подтверждённый контекст архитектуры. Это помогает находить скрытые вызовы сервисов перед правкой кода. CX Codex +1 ★ 10звёзд репо designing-architecture CloudAI-X Скилл designing-architecture для Claude Code помогает выбрать архитектурный паттерн, оценить размер проекта и команды и структурировать код. Включается при проектировании системы и принятии архитектурных решений. CX Codex +1 ★ 1 424звёзд репо

Из того же набора31

Весь набор →
encore-go-secret Скилл encore-go-secret для Claude Code подключает секреты Encore Go через поля package-level структуры secrets. Срабатывает для API-ключей и других приватных учётных данных. CX Codex +1 362установок encore-go-pubsub Скилл encore-go-pubsub для Claude Code описывает асинхронный обмен сообщениями в Encore Go через topics и subscriptions. Помогает публиковать события и обрабатывать их в фоне. CX Codex +1 360установок encore-go-bucket Скилл encore-go-bucket для Claude Code и Codex: работа с объектным хранилищем Encore Go через objects.NewBucket. Загружает, скачивает, удаляет файлы и генерирует подписанные URL для прямого доступа клиентов. CX Codex +1 359установок encore-go-webhook Скилл encore-go-webhook помогает принимать webhook-события в Encore Go через raw HTTP, проверять подписи и передавать обработку в Pub/Sub. CX Codex +1 358установок encore-go-cron Скилл encore-go-cron для Claude Code учит агента объявлять периодические задачи в Encore Go через cron.NewJob. Задаёт расписание вместо обработки входящего запроса. CX Codex +1 357установок encore-go-cache Скилл encore-go-cache учит агента писать кэш в Redis из Go-сервисов на Encore: типизированные keyspaces, TTL, атомарные счётчики. CX Codex +1 355установок encore-logging Скилл encore-logging учит агента расставлять структурные логи в Encore.ts через encore.dev/log: что писать, с каким уровнем и какими полями. CX Codex +1 168установок encore-go-logging Скилл encore-go-logging для Claude Code помогает добавлять и разбирать структурированные логи в сервисах Encore.go. Включается при работе с уровнями логирования, полями событий и объёмом логов. CX Codex +1 136установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой