
encore-architecture
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.
- Installs
- 119
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/encoredev/skills --skill encore-architecture- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads encore-architecture automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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 for the full guide and language-specific examples.
FAQ
What does the encore-architecture skill do?
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.
How do I install encore-architecture?
Run npx skills add https://github.com/encoredev/skills --skill encore-architecture in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/encore-architecture/ (personal) or .claude/skills/encore-architecture/ (project).
Which AI agents can use encore-architecture?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is encore-architecture safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains encore-architecture?
It is published by encoredev in encoredev/skills. It has 119 recorded installs.
More from encoredev/skills
encore-api
encoredev/skills
Define typed API endpoints in Encore.ts using api(...) from encore.dev/api. Covers typed request/response interfaces, path/query/header/cookie params, request validation, and APIError. For raw endpoints (api.raw()) and inbound webhooks, use encore-webhook instead.
encore-auth
encoredev/skills
Protect Encore.ts endpoints with authentication and authorize callers. Covers authHandler, Gateway, getAuthData, and auth: true.
encore-code-review
encoredev/skills
Review existing Encore.ts code for best practices and common anti-patterns.
encore-service
encoredev/skills
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.
encore-database
encoredev/skills
Work with PostgreSQL in Encore.ts using SQLDatabase from encore.dev/storage/sqldb — schema migrations and SQL queries.
encore-testing
encoredev/skills
Write or run automated tests for Encore.ts code with encore test and vitest/jest. Covers isolated per-test databases, calling handlers directly, and describe/it/expect.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.